mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-11-14 05:36:48 +03:00
fixed crash loading broken color profile from file-like object
This commit is contained in:
parent
a8304648af
commit
a36338f195
|
@ -134,8 +134,10 @@ cms_profile_fromstring(PyObject* self, PyObject* args)
|
||||||
cmsErrorAction(LCMS_ERROR_IGNORE);
|
cmsErrorAction(LCMS_ERROR_IGNORE);
|
||||||
|
|
||||||
hProfile = cmsOpenProfileFromMem(pProfile, nProfile);
|
hProfile = cmsOpenProfileFromMem(pProfile, nProfile);
|
||||||
if (!hProfile)
|
if (!hProfile) {
|
||||||
PyErr_SetString(PyExc_IOError, "cannot open profile from string");
|
PyErr_SetString(PyExc_IOError, "cannot open profile from string");
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return cms_profile_new(hProfile);
|
return cms_profile_new(hProfile);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user