clover: Use cl_ulong in the maximum allocation size calculation to avoid overflow.
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user