From a36338f1952bcb246ef291860fcd25bcebddd756 Mon Sep 17 00:00:00 2001 From: d-schmidt Date: Wed, 9 Jan 2013 21:04:02 +0100 Subject: [PATCH] fixed crash loading broken color profile from file-like object --- _imagingcms.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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); }