diff --git a/src/_imaging.c b/src/_imaging.c index 0888188fb20..8921e809f6b 100644 --- a/src/_imaging.c +++ b/src/_imaging.c @@ -929,6 +929,9 @@ static PyObject * _convert_matrix(ImagingObject *self, PyObject *args) { char *mode; float m[12]; + Imaging imOut; + ImagingSectionCookie cookie; + if (!PyArg_ParseTuple(args, "s(ffff)", &mode, m + 0, m + 1, m + 2, m + 3)) { PyErr_Clear(); if (!PyArg_ParseTuple( @@ -950,8 +953,10 @@ _convert_matrix(ImagingObject *self, PyObject *args) { return NULL; } } - - return PyImagingNew(ImagingConvertMatrix(self->image, mode, m)); + ImagingSectionEnter(&cookie); + imOut = ImagingConvertMatrix(self->image, mode, m); + ImagingSectionLeave(&cookie); + return PyImagingNew(imOut); } static PyObject *