diff options
author | James Almer <jamrial@gmail.com> | 2015-06-16 17:27:20 +0100 |
---|---|---|
committer | Vittorio Giovara <vittorio.giovara@gmail.com> | 2015-06-17 14:13:43 +0100 |
commit | 1e79d5c6e73ad131f9395f337b58a2b59ee04c1b (patch) | |
tree | b197a8fc77a2909f37bb40105317af3aff032ddc | |
parent | d8d124eebcf2ec1f6a1936b12a4f00a48f08e85c (diff) | |
download | ffmpeg-1e79d5c6e73ad131f9395f337b58a2b59ee04c1b.tar.gz |
libwebpenc: use WebPMemoryWriterClear()
WebPMemoryWriterClear() must be used instead of free() when
libwebp ABI version is > 0x0203.
Signed-off-by: James Almer <jamrial@gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
-rw-r--r-- | libavcodec/libwebpenc.c | 4 |
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); |