]> granicus.if.org Git - handbrake/commitdiff
OpenCL: fix type of numDevices variable.
authorRodeo <tdskywalker@gmail.com>
Mon, 20 May 2013 19:36:05 +0000 (19:36 +0000)
committerRodeo <tdskywalker@gmail.com>
Mon, 20 May 2013 19:36:05 +0000 (19:36 +0000)
Was causing malloc failures and out of array read/writes under OS X.

git-svn-id: svn://svn.handbrake.fr/HandBrake/branches/opencl@5491 b64f7644-9d1e-0410-96f1-a4d463321fa5

libhb/openclwrapper.c

index 710c4defbec65ad1f0643b5ebbd0f6c01008eb60..5e9b0a68b6ae03c99fee2f37ac68aaea61bc051b 100644 (file)
@@ -227,7 +227,7 @@ int hb_binary_generated( cl_context context, const char * cl_file_name, FILE **
 {\r
     int i = 0;\r
     cl_int status;\r
-    size_t numDevices;\r
+    cl_uint numDevices;\r
     cl_device_id *devices;\r
     char * str = NULL;\r
     FILE * fd = NULL;\r
@@ -320,7 +320,8 @@ int hb_generat_bin_from_kernel_source( cl_program program, const char * cl_file_
 {\r
     int i = 0;\r
     cl_int status;\r
-    size_t *binarySizes, numDevices;\r
+    cl_uint numDevices;\r
+    size_t *binarySizes;\r
     cl_device_id *devices;\r
     char **binaries;\r
     char *str = NULL;\r
@@ -774,7 +775,7 @@ int hb_compile_kernel_file( const char *filename, GPUEnv *gpu_info,
     char *buildLog = NULL;\r
     int b_error, binary_status, binaryExisted;\r
     char * binary;\r
-    size_t numDevices;\r
+    cl_uint numDevices;\r
     cl_device_id *devices;\r
     FILE * fd;\r
     FILE * fd1;\r
@@ -1062,7 +1063,7 @@ int hb_get_opencl_env()
 {\r
     int i = 0;\r
     cl_int status;\r
-    size_t numDevices;\r
+    cl_uint numDevices;\r
     cl_device_id *devices;\r
 \r
     /*initialize devices, context, comand_queue*/\r