aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-08-01 21:10:43 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-08-01 21:20:43 +0200
commitd6173ae341fabacf05608ceb7470d24befdbdc68 (patch)
treefb43e0f085f2b4939e8749873845fdcd3fe32f77
parent3ed27832e7b05745822781603fa6978aff6be24c (diff)
downloadffmpeg-d6173ae341fabacf05608ceb7470d24befdbdc68.tar.gz
avcodec/mpeg12dec: fix support for interlaced mpeg2 with missing last slice
Fixes Ticket3809 Signed-off-by: Michael Niedermayer <michaelni@gmx.at> (cherry picked from commit f95298c913899207344d668a6d5624cb2d2e480c) Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r--libavcodec/mpeg12dec.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c
index fcc1d4c48b..0eecb7d1f7 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);
}