summaryrefslogtreecommitdiff
path: root/libavcodec/mpegvideo_enc.c
diff options
context:
space:
mode:
authorTimo Rothenpieler <timo@rothenpieler.org>2016-09-25 15:41:47 +0200
committerTimo Rothenpieler <timo@rothenpieler.org>2016-09-26 18:21:00 +0200
commit99b823f0a1be42abc0f3a6a0da946c4464db5fb6 (patch)
tree8439302be7afdb6c989dc56c542a90b5ca998cda /libavcodec/mpegvideo_enc.c
parent46aae846165c35e6d184087542dd3e610fa36506 (diff)
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.
Diffstat (limited to 'libavcodec/mpegvideo_enc.c')
-rw-r--r--libavcodec/mpegvideo_enc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/mpegvideo_enc.c b/libavcodec/mpegvideo_enc.c
index 87d795478a..5cd654f526 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