Commit 1e79d5c6 authored by James Almer's avatar James Almer Committed by Vittorio Giovara

libwebpenc: use WebPMemoryWriterClear()

WebPMemoryWriterClear() must be used instead of free() when
libwebp ABI version is > 0x0203.
Signed-off-by: 's avatarJames Almer <jamrial@gmail.com>
Signed-off-by: 's avatarVittorio Giovara <vittorio.giovara@gmail.com>
parent d8d124ee
...@@ -231,7 +231,11 @@ static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt, ...@@ -231,7 +231,11 @@ static int libwebp_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
*got_packet = 1; *got_packet = 1;
end: end:
#if (WEBP_ENCODER_ABI_VERSION > 0x0203)
WebPMemoryWriterClear(&mw);
#else
free(mw.mem); /* must use free() according to libwebp documentation */ free(mw.mem); /* must use free() according to libwebp documentation */
#endif
WebPPictureFree(pic); WebPPictureFree(pic);
av_freep(&pic); av_freep(&pic);
av_frame_free(&alt_frame); av_frame_free(&alt_frame);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment