[Beignet] [PATCH] cl_api; Check image origin and region for NULL
Jan Vesely
jano.vesely at gmail.com
Fri Apr 29 02:43:29 UTC 2016
Signed-off-by: Jan Vesely <jano.vesely at gmail.com>
---
src/cl_utils.h | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/src/cl_utils.h b/src/cl_utils.h
index 0934d5f..2926611 100644
--- a/src/cl_utils.h
+++ b/src/cl_utils.h
@@ -169,6 +169,11 @@ IMAGE = cl_mem_image(MEM); \
const size_t *REGION; \
size_t REGION ##_REC[3]; \
do { \
+ if (PREGION == NULL) \
+ { \
+ err = CL_INVALID_VALUE; \
+ goto error; \
+ } \
if (IMAGE->image_type == CL_MEM_OBJECT_IMAGE1D_ARRAY) { \
REGION ##_REC[0] = PREGION[0]; \
REGION ##_REC[1] = 1; \
@@ -188,6 +193,11 @@ do { \
const size_t *REGION; \
size_t REGION ##_REC[3]; \
do { \
+ if (PREGION == NULL) \
+ { \
+ err = CL_INVALID_VALUE; \
+ goto error; \
+ } \
if (IMAGE->image_type == CL_MEM_OBJECT_IMAGE1D_ARRAY) { \
REGION ##_REC[0] = PREGION[0]; \
REGION ##_REC[1] = 0; \
--
2.7.4
More information about the Beignet
mailing list