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>
This commit is contained in:
James Almer 2014-08-27 15:39:50 -03:00
parent 7c51f5bd39
commit 7997d78643
1 changed files with 4 additions and 0 deletions

View File

@ -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);