From 8e8ef05e3066aaf7bf294752e29508f46bdd2eb0 Mon Sep 17 00:00:00 2001 From: Vincent Danjean Date: Wed, 23 Oct 2013 12:25:47 +0200 Subject: [PATCH] Also check for NULL events --- ocl_icd_loader.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/ocl_icd_loader.c b/ocl_icd_loader.c index 05397df..0972dc9 100644 --- a/ocl_icd_loader.c +++ b/ocl_icd_loader.c @@ -776,7 +776,7 @@ clCreateContextFromType(const cl_context_properties * properties , if( properties != NULL){ while( properties[i] != 0 ) { if( properties[i] == CL_CONTEXT_PLATFORM ) { - if (properties[i+1] == 0) { + if( (struct _cl_platform_id *) properties[i+1] == NULL ) { goto out; } else { if( !CHECK_PLATFORM((cl_platform_id) properties[i+1]) ) { @@ -830,7 +830,7 @@ clGetGLContextInfoKHR(const cl_context_properties * properties , if( properties != NULL){ while( properties[i] != 0 ) { if( properties[i] == CL_CONTEXT_PLATFORM ) { - if((struct _cl_platform_id *) properties[i+1] == NULL) { + if( (struct _cl_platform_id *) properties[i+1] == NULL ) { RETURN(CL_INVALID_PLATFORM); } else { if( !CHECK_PLATFORM((cl_platform_id) properties[i+1]) ) { @@ -854,6 +854,8 @@ clWaitForEvents(cl_uint num_events , debug_trace(); if( num_events == 0 || event_list == NULL ) RETURN(CL_INVALID_VALUE); + if( (struct _cl_event *)event_list[0] == NULL ) + RETURN(CL_INVALID_EVENT); RETURN(((struct _cl_event *)event_list[0]) ->dispatch->clWaitForEvents(num_events, event_list)); } -- 2.32.0.93.g670b81a890