Skip to content

Commit 7f22b34

Browse files
committed
Merge pull request opencv#18092 from alalek:ocl_fix_image_format
2 parents ad63d24 + 00890ae commit 7f22b34

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

modules/core/src/ocl.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6458,6 +6458,9 @@ struct Image2D::Impl
64586458
CV_Error(Error::OpenCLApiCallError, "OpenCL runtime not found!");
64596459

64606460
cl_context context = (cl_context)Context::getDefault().ptr();
6461+
if (!context)
6462+
return false;
6463+
64616464
// Figure out how many formats are supported by this context.
64626465
cl_uint numFormats = 0;
64636466
cl_int err = clGetSupportedImageFormats(context, CL_MEM_READ_WRITE,

0 commit comments

Comments
 (0)