From c062b6cf5680afdf8024bad74e563e15d99f3fac Mon Sep 17 00:00:00 2001 From: dirk Date: Tue, 22 Mar 2016 23:25:05 +0100 Subject: [PATCH] Fixed off by one issue and increased buffer size. --- MagickCore/opencl-private.h | 2 +- MagickCore/opencl.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/MagickCore/opencl-private.h b/MagickCore/opencl-private.h index cfc39eb84..86c1e7be0 100644 --- a/MagickCore/opencl-private.h +++ b/MagickCore/opencl-private.h @@ -39,7 +39,7 @@ extern "C" { typedef struct { unsigned char t[8]; } cl_device_type; /* 64-bit */ #else -#define MAX_COMMAND_QUEUES 8 +#define MAX_COMMAND_QUEUES 16 /* * diff --git a/MagickCore/opencl.c b/MagickCore/opencl.c index b47103280..3a4097b83 100644 --- a/MagickCore/opencl.c +++ b/MagickCore/opencl.c @@ -1512,7 +1512,7 @@ MagickPrivate MagickBooleanType RelinquishOpenCLCommandQueue(MagickCLEnv clEnv, LockSemaphoreInfo(clEnv->commandQueuesLock); - if (clEnv->commandQueuesPos >= MAX_COMMAND_QUEUES) + if (clEnv->commandQueuesPos >= MAX_COMMAND_QUEUES-1) status=(clEnv->library->clReleaseCommandQueue(queue) == CL_SUCCESS) ? MagickTrue : MagickFalse; else -- 2.40.0