From 1b11428101d390e482f6a67adba27f42cda7f4a8 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Sat, 17 Aug 2013 07:09:07 +0000 Subject: fix for crash in compositor/opencl, the error value of -1001 would read past the error-string array. --- source/blender/compositor/intern/COM_WorkScheduler.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'source/blender/compositor/intern') diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cpp b/source/blender/compositor/intern/COM_WorkScheduler.cpp index 1bac06fc4ab..330e61e7fea 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.cpp +++ b/source/blender/compositor/intern/COM_WorkScheduler.cpp @@ -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); -- cgit v1.2.3