mpeg12: clean current picture ptr.
authorMichael Niedermayer <michaelni@gmx.at>
Sun, 11 Nov 2012 22:24:54 +0000 (23:24 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 12 Nov 2012 00:43:11 +0000 (01:43 +0100)
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@gmx.at>
libavcodec/mpeg12.c

index b5bf68d..234cac4 100644 (file)
@@ -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) {