Merge pull request #33 from d-schmidt/bugfix

fixed crash loading broken color profile from file-like object
This commit is contained in:
Alex Clark ☺ 2013-01-10 04:45:50 -08:00
commit eaf27c93bd

View File

@ -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);
}