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>
pull/138/head
James Almer 10 years ago committed by Vittorio Giovara
parent d8d124eebc
commit 1e79d5c6e7
  1. 4
      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);

Loading…
Cancel
Save