diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2013-08-13 19:36:50 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2013-08-13 19:36:50 +0200 |
commit | 97064019279d227669ea3db583a8a8aa47e970ba (patch) | |
tree | ee727ca00b1d84329ec70b4bf64af12c1cfa2af2 | |
parent | 6a64b23d93d05b765fbeff51b75d0c75e940bf9a (diff) | |
download | ffmpeg-streaming-97064019279d227669ea3db583a8a8aa47e970ba.zip ffmpeg-streaming-97064019279d227669ea3db583a8a8aa47e970ba.tar.gz |
avcodec/mpeg12dec: check slice size before trying to decode it
Fixes assertion failure
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/mpeg12dec.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/mpeg12dec.c b/libavcodec/mpeg12dec.c index 9b17941..262a5a3 100644 --- a/libavcodec/mpeg12dec.c +++ b/libavcodec/mpeg12dec.c @@ -2299,6 +2299,11 @@ static int decode_chunks(AVCodecContext *avctx, if (s2->picture_structure == PICT_BOTTOM_FIELD) mb_y++; + if (buf_end - buf_ptr < 2) { + av_log(s2->avctx, AV_LOG_ERROR, "slice too small\n"); + return AVERROR_INVALIDDATA; + } + if (mb_y >= s2->mb_height) { av_log(s2->avctx, AV_LOG_ERROR, "slice below image (%d >= %d)\n", mb_y, s2->mb_height); return -1; |