diff --git a/include/CL/opencl.hpp b/include/CL/opencl.hpp index 192b65e1..ad799167 100644 --- a/include/CL/opencl.hpp +++ b/include/CL/opencl.hpp @@ -3648,8 +3648,8 @@ class Context cl_mem_object_type type, vector* formats) const { - if (!formats) { - return CL_SUCCESS; + if( formats == nullptr ) { + return detail::errHandler(CL_INVALID_ARG_VALUE, __GET_SUPPORTED_IMAGE_FORMATS_ERR); } return getSupportedImageFormats(flags, type, *formats); }