[FFmpeg-cvslog] avcodec/mpegvideo_enc: fix memory leak

Timo Rothenpieler git at videolan.org
Mon Sep 26 19:46:19 EEST 2016


ffmpeg | branch: master | Timo Rothenpieler <timo at rothenpieler.org> | Sun Sep 25 15:41:47 2016 +0200| [99b823f0a1be42abc0f3a6a0da946c4464db5fb6] | committer: Timo Rothenpieler

avcodec/mpegvideo_enc: fix memory leak

When the input frames contain side data, it will accumulate endlessly in
the coded frame, as av_frame_copy_props will append any new side data.

Fixes ticket #5799.

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

 libavcodec/mpegvideo_enc.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 87d7954..5cd654f 100644
--- a/libavcodec/mpegvideo_enc.c
+++ b/libavcodec/mpegvideo_enc.c
@@ -1735,6 +1735,7 @@ static void frame_end(MpegEncContext *s)
 
 #if FF_API_CODED_FRAME
 FF_DISABLE_DEPRECATION_WARNINGS
+    av_frame_unref(s->avctx->coded_frame);
     av_frame_copy_props(s->avctx->coded_frame, s->current_picture.f);
 FF_ENABLE_DEPRECATION_WARNINGS
 #endif



More information about the ffmpeg-cvslog mailing list