mirror of
https://github.com/python-pillow/Pillow.git
synced 2025-01-13 10:46:16 +03:00
Fixed memory leak saving images as webp when webpmux is available
This commit is contained in:
parent
e3ee9882ae
commit
2729401cc3
4
_webp.c
4
_webp.c
|
@ -113,11 +113,11 @@ PyObject* WebPEncode_wrapper(PyObject* self, PyObject* args)
|
||||||
|
|
||||||
WebPMuxAssemble(mux, &output_data);
|
WebPMuxAssemble(mux, &output_data);
|
||||||
WebPMuxDelete(mux);
|
WebPMuxDelete(mux);
|
||||||
|
free(output);
|
||||||
|
|
||||||
output = (uint8_t*)output_data.bytes;
|
|
||||||
ret_size = output_data.size;
|
ret_size = output_data.size;
|
||||||
if (ret_size > 0) {
|
if (ret_size > 0) {
|
||||||
PyObject *ret = PyBytes_FromStringAndSize((char*)output, ret_size);
|
PyObject *ret = PyBytes_FromStringAndSize((char*)output_data.bytes, ret_size);
|
||||||
WebPDataClear(&output_data);
|
WebPDataClear(&output_data);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user