Cycles: extra OpenCL NULL point check, maybe avoids some crashes. Don't think
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 28 Feb 2012 16:44:36 +0000 (16:44 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 28 Feb 2012 16:44:36 +0000 (16:44 +0000)
this should ever happen in practice but maybe it does anyway.

intern/cycles/util/util_opencl.cpp

index 1d05b0b687a4b86712699377a861e833b1d7e20a..4087c2c38237573029d8cd65830d0e08bf3d21bd 100644 (file)
@@ -235,6 +235,9 @@ int clLibraryInit()
     __clewEnqueueBarrier                = (PFNCLENQUEUEBARRIER              )CLCC_DYNLIB_IMPORT(module, "clEnqueueBarrier");
     __clewGetExtensionFunctionAddress   = (PFNCLGETEXTENSIONFUNCTIONADDRESS )CLCC_DYNLIB_IMPORT(module, "clGetExtensionFunctionAddress");
 
+       if(__clewGetPlatformIDs == NULL)
+               return 0;
+
     return 1;
 }