[FFmpeg-cvslog] libwebpenc: use WebPMemoryWriterClear()

James Almer git at videolan.org
Wed Jun 17 21:12:13 CEST 2015


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Tue Jun 16 17:27:20 2015 +0100| [1e79d5c6e73ad131f9395f337b58a2b59ee04c1b] | committer: Vittorio Giovara

libwebpenc: use WebPMemoryWriterClear()

WebPMemoryWriterClear() must be used instead of free() when
libwebp ABI version is > 0x0203.

Signed-off-by: James Almer <jamrial at gmail.com>
Signed-off-by: Vittorio Giovara <vittorio.giovara at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1e79d5c6e73ad131f9395f337b58a2b59ee04c1b
---

 libavcodec/libwebpenc.c |    4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/libwebpenc.c b/libavcodec/libwebpenc.c
index b981f48..ef311b7 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);



More information about the ffmpeg-cvslog mailing list