Skip to content

Commit 6b7c497

Browse files
authored
handle a command buffer creation negative test case (#349)
It is possible to pass in a nonzero number of queues but a null queue array pointer. This is an error, but we still shouldn't crash.
1 parent 362d6c1 commit 6b7c497

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

intercept/src/dispatch.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10351,7 +10351,7 @@ CL_API_ENTRY cl_command_buffer_khr CL_API_CALL clCreateCommandBufferKHR(
1035110351

1035210352
if( pIntercept )
1035310353
{
10354-
cl_command_queue queue = num_queues ? queues[0] : NULL;
10354+
cl_command_queue queue = num_queues && queues ? queues[0] : NULL;
1035510355
const auto& dispatchX = pIntercept->dispatchX(queue);
1035610356
if( dispatchX.clCreateCommandBufferKHR )
1035710357
{
@@ -11263,7 +11263,7 @@ CL_API_ENTRY cl_command_buffer_khr CL_API_CALL clRemapCommandBufferKHR(
1126311263

1126411264
if( pIntercept )
1126511265
{
11266-
cl_command_queue queue = num_queues ? queues[0] : NULL;
11266+
cl_command_queue queue = num_queues && queues ? queues[0] : NULL;
1126711267
const auto& dispatchX = pIntercept->dispatchX(queue);
1126811268
if( dispatchX.clRemapCommandBufferKHR )
1126911269
{

0 commit comments

Comments
 (0)