Fix: cycles crash with multiple OpenCL platforms installed, tracked down by Sergey.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 20 Feb 2012 14:19:34 +0000 (14:19 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Mon, 20 Feb 2012 14:19:34 +0000 (14:19 +0000)
intern/cycles/device/device_opencl.cpp

index 9a55f95789507f1fd92a71f78751fc7c8d87c756..c2eee04f3fe2609e042e3fff530182d8f5decef6 100644 (file)
@@ -165,7 +165,7 @@ public:
                        return;
                }
 
-               ciErr = clGetPlatformIDs(num_platforms, &cpPlatform, NULL);
+               ciErr = clGetPlatformIDs(1, &cpPlatform, NULL);
                if(opencl_error(ciErr))
                        return;
 
@@ -709,7 +709,7 @@ void device_opencl_info(vector<DeviceInfo>& devices)
        if(clGetPlatformIDs(0, NULL, &num_platforms) != CL_SUCCESS || num_platforms == 0)
                return;
 
-       if(clGetPlatformIDs(num_platforms, &platform_id, NULL) != CL_SUCCESS)
+       if(clGetPlatformIDs(1, &platform_id, NULL) != CL_SUCCESS)
                return;
 
        if(clGetDeviceIDs(platform_id, CL_DEVICE_TYPE_GPU|CL_DEVICE_TYPE_ACCELERATOR, 0, NULL, &num_devices) != CL_SUCCESS)