mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-02-04 21:50:54 +03:00
Release buffer on error
Co-authored-by: Ondrej Baranovič <nulano@nulano.eu>
This commit is contained in:
parent
b970eb9e5d
commit
494a3bcf2b
|
@ -202,6 +202,7 @@ _frombytes(ImagingDisplayObject *display, PyObject *args) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (display->dib->ysize * display->dib->linesize != buffer.len) {
|
if (display->dib->ysize * display->dib->linesize != buffer.len) {
|
||||||
|
PyBuffer_Release(&buffer);
|
||||||
PyErr_SetString(PyExc_ValueError, "wrong size");
|
PyErr_SetString(PyExc_ValueError, "wrong size");
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user