diff options
author | James Almer <jamrial@gmail.com> | 2014-08-27 15:39:50 -0300 |
---|---|---|
committer | James Almer <jamrial@gmail.com> | 2014-08-27 15:42:13 -0300 |
commit | 7997d78643797d6d26babc4eabbda71049457169 (patch) | |
tree | 08e1eb52e72513588fb4eb1251f67540adab399f | |
parent | 7c51f5bd3903a9eaf80af64495174db8809ef31e (diff) | |
download | ffmpeg-7997d78643797d6d26babc4eabbda71049457169.tar.gz |
lavc/libwebpenc: use WebPMemoryWriterClear()
WebPMemoryWriterClear() must be used instead of free() when libwebp ABI version is > 0x0203
Reviewed-by: Michael Niedermayer <michaelni@gmx.at>
Signed-off-by: James Almer <jamrial@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 5283da5070..4cb8dc384e 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); |