mirror of
https://github.com/python-pillow/Pillow.git
synced 2024-12-28 19:06:18 +03:00
WebP: Fix memory leak during decoding on failure
When creating the `WebPAnimDecoder` object, we create a `WebPAnimDecoderObject` and populate its data using `WebPDataCopy()`. Subsequently, if either `WebPAnimDecoderNew()` or `WebPAnimDecoderGetInfo()` fails, data is not currently deallocated. This commit clears the decoder object's data in that situation.
This commit is contained in:
parent
caa0deb4c7
commit
596e80c654
|
@ -392,6 +392,7 @@ _anim_decoder_new(PyObject *self, PyObject *args) {
|
|||
return (PyObject *)decp;
|
||||
}
|
||||
}
|
||||
WebPDataClear(&(decp->data));
|
||||
}
|
||||
PyObject_Del(decp);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user