diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2014-01-24 20:45:26 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2014-01-24 21:09:17 +0400 |
commit | 76b5e99ce9c1245e2e426203a1f535a5d83cced6 (patch) | |
tree | 9c35dfa4e97332b3b82e265125b7ce01fb3f0ac2 /libavcodec/mpeg12dec.c | |
parent | d82eccea2bf905cd51889954658f4e7f64876df8 (diff) |
avcodec/mpeg12dec: Check for overread in mpeg_decode_slice()
This is needed in case the checked bitstream reader is disabled
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/mpeg12dec.c')
-rw-r--r-- | libavcodec/mpeg12dec.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index f574997687..60c1a714a6 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -1846,6 +1846,8 @@ static int mpeg_decode_slice(MpegEncContext *s, int mb_y, } } eos: // end of slice + if (get_bits_left(&s->gb) < 0) + return AVERROR_INVALIDDATA; *buf += (get_bits_count(&s->gb)-1)/8; av_dlog(s, "y %d %d %d %d\n", s->resync_mb_x, s->resync_mb_y, s->mb_x, s->mb_y); return 0; |