diff options
author | Gil Pitney <gil.pitney@linaro.org> | 2015-07-20 22:41:40 +0000 |
---|---|---|
committer | Gil Pitney <gil.pitney@linaro.org> | 2015-07-20 22:41:40 +0000 |
commit | 2091e81b5db36054644e2816e32beccf946a2f09 (patch) | |
tree | 49b3b914f265622a883555fcd35f136fc499c994 | |
parent | b4876f992060d0d4fe250cf1f5e68d71c13b30f4 (diff) |
BufferEvent::isSubBufferAligned(): test for null buffer.
It is possible that the callee is passing a null buffer, which is
a valid value per the v1.2 spec for a kernel argument.
This patch enables the v1.2 Khronos test:
% test_api null_buffer_arg
to PASS.
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
-rw-r--r-- | src/core/events.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/core/events.cpp b/src/core/events.cpp index 95433b7..7fa573a 100644 --- a/src/core/events.cpp +++ b/src/core/events.cpp @@ -116,7 +116,7 @@ bool BufferEvent::isSubBufferAligned(const MemObject *buffer, cl_uint align; cl_int rs; - if (buffer->type() != MemObject::SubBuffer) + if (!buffer || buffer->type() != MemObject::SubBuffer) return true; rs = device->info(CL_DEVICE_MEM_BASE_ADDR_ALIGN, sizeof(uint), |