From: dirk Date: Tue, 22 Mar 2016 22:25:05 +0000 (+0100) Subject: Fixed off by one issue and increased buffer size. X-Git-Tag: 7.0.1-0~146 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c062b6cf5680afdf8024bad74e563e15d99f3fac;p=imagemagick Fixed off by one issue and increased buffer size. --- 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