Browse Source

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>
tags/n2.8
James Almer Vittorio Giovara 10 years ago
parent
commit
1e79d5c6e7
1 changed files with 4 additions and 0 deletions
  1. +4
    -0
      libavcodec/libwebpenc.c

+ 4
- 0
libavcodec/libwebpenc.c 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);


Loading…
Cancel
Save