Package: clblas
Version: 2.12-1
Control: tags -1 patch

(Split from #881054: cloning a merged bug is not allowed, and both original reports better match the other part.)

After a compile failure (e.g. due to #881054), clblas crashes trying to dereference a NULL pointer.

Fix:

diff --git a/src/library/blas/generic/common2.cc b/src/library/blas/generic/common2.cc
index 05bbdc6..609e5de 100644
--- a/src/library/blas/generic/common2.cc
+++ b/src/library/blas/generic/common2.cc
@@ -85,9 +85,11 @@ extern "C" Kernel* makeKernelCached(cl_device_id device,
                                      buildOpts,
                                      error);

-        bl.setProgram(kernel->program);
-
-        bl.populateCache();
+        if (kernel != NULL)
+        {
+            bl.setProgram(kernel->program);
+            bl.populateCache();
+        }

         return kernel;
     }

Reply via email to