Browse Source

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.
tags/n3.2
Timo Rothenpieler 9 years ago
parent
commit
99b823f0a1
1 changed files with 1 additions and 0 deletions
  1. +1
    -0
      libavcodec/mpegvideo_enc.c

+ 1
- 0
libavcodec/mpegvideo_enc.c View File

@@ -1735,6 +1735,7 @@ static void frame_end(MpegEncContext *s)


#if FF_API_CODED_FRAME #if FF_API_CODED_FRAME
FF_DISABLE_DEPRECATION_WARNINGS FF_DISABLE_DEPRECATION_WARNINGS
av_frame_unref(s->avctx->coded_frame);
av_frame_copy_props(s->avctx->coded_frame, s->current_picture.f); av_frame_copy_props(s->avctx->coded_frame, s->current_picture.f);
FF_ENABLE_DEPRECATION_WARNINGS FF_ENABLE_DEPRECATION_WARNINGS
#endif #endif


Loading…
Cancel
Save