[FFmpeg-cvslog] mpeg12: clean current picture ptr.

Michael Niedermayer git at videolan.org
Mon Nov 12 01:53:14 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Nov 11 23:24:54 2012 +0100| [8824a9ed2291d2b004dc641bd9ea8ad6f983466a] | committer: Michael Niedermayer

mpeg12: clean current picture ptr.

This avoids having a stray pointer left that may not represent the current picture
and state.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/mpeg12.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index b5bf68d..234cac4 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -2528,6 +2528,8 @@ static int mpeg_decode_frame(AVCodecContext *avctx,
     MpegEncContext *s2 = &s->mpeg_enc_ctx;
     av_dlog(avctx, "fill_buffer\n");
 
+    s2->current_picture_ptr = NULL;
+
     if (buf_size == 0 || (buf_size == 4 && AV_RB32(buf) == SEQ_END_CODE)) {
         /* special case for last picture */
         if (s2->low_delay == 0 && s2->next_picture_ptr) {



More information about the ffmpeg-cvslog mailing list