diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index e78c54942b..27bb6e0809 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1884,6 +1884,14 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, } else goto eos; } + if (s->mb_y >= ((s->height + 15) >> 4) && + s->progressive_frame && + !s->progressive_sequence && + get_bits_left(&s->gb) <= 8 && + get_bits_left(&s->gb) >= 0 && + s->mb_skip_run == -1 && + show_bits(&s->gb, 8) == 0) + goto eos; ff_init_block_index(s); }