From 8824a9ed2291d2b004dc641bd9ea8ad6f983466a Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Sun, 11 Nov 2012 23:24:54 +0100 Subject: [PATCH] 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 --- libavcodec/mpeg12.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c index b5bf68d683..234cac49f2 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) {