[FFmpeg-cvslog] mpegvideo: release frame buffers before freeing them

Janne Grunau git at videolan.org
Thu Sep 20 04:44:41 CEST 2012


ffmpeg | branch: master | Janne Grunau <janne-libav at jannau.net> | Wed Sep 19 19:39:52 2012 +0200| [32c7589bb7ce6b8be733aa88e4786955c7c3a638] | committer: Janne Grunau

mpegvideo: release frame buffers before freeing them

Fixes triggering an assert in avcodec_default_release_buffer()
introduced in 1b3439b30.

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

 libavcodec/mpegvideo.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index e2e5276..4682ab1 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -1104,14 +1104,15 @@ void ff_MPV_common_end(MpegEncContext *s)
     av_freep(&s->reordered_input_picture);
     av_freep(&s->dct_offset);
 
-    free_context_frame(s);
-
     if (s->picture && !s->avctx->internal->is_copy) {
         for (i = 0; i < s->picture_count; i++) {
             free_picture(s, &s->picture[i]);
         }
     }
     av_freep(&s->picture);
+
+    free_context_frame(s);
+
     s->context_initialized      = 0;
     s->last_picture_ptr         =
     s->next_picture_ptr         =



More information about the ffmpeg-cvslog mailing list