We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84b88a9 commit eaab435Copy full SHA for eaab435
src/_webp.c
@@ -641,6 +641,10 @@ WebPEncode_wrapper(PyObject *self, PyObject *args) {
641
ImagingSectionLeave(&cookie);
642
643
WebPPictureFree(&pic);
644
+
645
+ output = writer.mem;
646
+ ret_size = writer.size;
647
648
if (!ok) {
649
int error_code = (&pic)->error_code;
650
char message[50] = "";
@@ -652,10 +656,9 @@ WebPEncode_wrapper(PyObject *self, PyObject *args) {
652
656
);
653
657
}
654
658
PyErr_Format(PyExc_ValueError, "encoding error %d%s", error_code, message);
659
+ free(output);
655
660
return NULL;
661
- output = writer.mem;
- ret_size = writer.size;
662
663
{
664
/* I want to truncate the *_size items that get passed into WebP
0 commit comments