summaryrefslogtreecommitdiff
path: root/libavcodec/libwebpenc.c
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/libwebpenc.c')
-rw-r--r--libavcodec/libwebpenc.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libavcodec/libwebpenc.c b/libavcodec/libwebpenc.c
index b981f48245..ef311b7592 100644
--- a/libavcodec/libwebpenc.c
+++ b/libavcodec/libwebpenc.c
@@ -231,7 +231,11 @@ static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
*got_packet = 1;
end:
+#if (WEBP_ENCODER_ABI_VERSION > 0x0203)
+ WebPMemoryWriterClear(&mw);
+#else
free(mw.mem); /* must use free() according to libwebp documentation */
+#endif
WebPPictureFree(pic);
av_freep(&pic);
av_frame_free(&alt_frame);