diff options
author | Francisco Jerez <[email protected]> | 2014-01-14 21:38:11 +0100 |
---|---|---|
committer | Francisco Jerez <[email protected]> | 2014-01-14 22:10:24 +0100 |
commit | e457aca7fa477bfa2fbd57f1d0c8155206cfd8e8 (patch) | |
tree | 382a8ceecc887e3b306ac78b32c1a55e8aef9f6a | |
parent | 8c4a9f631d7438aeaf56785401891d0773792123 (diff) |
clover: Use cl_ulong in the maximum allocation size calculation to avoid overflow.
-rw-r--r-- | src/gallium/state_trackers/clover/api/memory.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
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); |