From: Francisco Jerez Date: Tue, 14 Jan 2014 20:38:11 +0000 (+0100) Subject: clover: Use cl_ulong in the maximum allocation size calculation to avoid overflow. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e457aca7fa477bfa2fbd57f1d0c8155206cfd8e8;p=mesa.git clover: Use cl_ulong in the maximum allocation size calculation to avoid overflow. --- diff --git a/src/gallium/state_trackers/clover/api/memory.cpp b/src/gallium/state_trackers/clover/api/memory.cpp index b8b3692a65d..e51a7291732 100644 --- a/src/gallium/state_trackers/clover/api/memory.cpp +++ b/src/gallium/state_trackers/clover/api/memory.cpp @@ -37,7 +37,7 @@ clCreateBuffer(cl_context d_ctx, cl_mem_flags flags, size_t size, throw error(CL_INVALID_HOST_PTR); if (!size || - size > fold(maximum(), 0u, + size > fold(maximum(), cl_ulong(0), map(std::mem_fn(&device::max_mem_alloc_size), ctx.devs()) )) throw error(CL_INVALID_BUFFER_SIZE);