diff --git a/_imagingcms.c b/_imagingcms.c index e9a3b00c5..a53351f42 100644 --- a/_imagingcms.c +++ b/_imagingcms.c @@ -134,8 +134,10 @@ cms_profile_fromstring(PyObject* self, PyObject* args) cmsErrorAction(LCMS_ERROR_IGNORE); hProfile = cmsOpenProfileFromMem(pProfile, nProfile); - if (!hProfile) + if (!hProfile) { PyErr_SetString(PyExc_IOError, "cannot open profile from string"); + return NULL; + } return cms_profile_new(hProfile); }