fix for crash in compositor/opencl, the error value of -1001 would read past the error-string array.
This commit is contained in:
@@ -313,7 +313,8 @@ void WorkScheduler::initialize(bool use_opencl)
|
||||
cl_uint numberOfPlatforms = 0;
|
||||
cl_int error;
|
||||
error = clGetPlatformIDs(0, 0, &numberOfPlatforms);
|
||||
if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); }
|
||||
if (error == -1001) { } /* GPU not supported */
|
||||
else if (error != CL_SUCCESS) { printf("CLERROR[%d]: %s\n", error, clewErrorString(error)); }
|
||||
if (G.f & G_DEBUG) printf("%d number of platforms\n", numberOfPlatforms);
|
||||
cl_platform_id *platforms = (cl_platform_id *)MEM_mallocN(sizeof(cl_platform_id) * numberOfPlatforms, __func__);
|
||||
error = clGetPlatformIDs(numberOfPlatforms, platforms, 0);
|
||||
|
Reference in New Issue
Block a user