diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2018-01-28 02:29:00 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2018-01-30 22:49:55 +0100 |
commit | 6723a436095f76f6d1edec4de21b2a0b47954067 (patch) | |
tree | 046f2155e3f72e309b6bac1f4083d3fdc9a03250 /libavcodec | |
parent | 2980b95fafb39148cfade120eab5c75b46bfffc6 (diff) | |
download | ffmpeg-6723a436095f76f6d1edec4de21b2a0b47954067.tar.gz |
avcodec/mpeg4videodec: Check mb_num also against 0
The spec implies that 0 is invalid in addition to the existing checks
Found-by: <kierank>
Reviewed-by: Kieran Kunhya <kieran618@googlemail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 05f4703a168a336363750e32bcfdd6f303fbdbc3)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/mpeg4videodec.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c index 8eafc783b8..afa41a8641 100644 --- a/libavcodec/mpeg4videodec.c +++ b/libavcodec/mpeg4videodec.c @@ -460,7 +460,7 @@ int ff_mpeg4_decode_video_packet_header(Mpeg4DecContext *ctx) } mb_num = get_bits(&s->gb, mb_num_bits); - if (mb_num >= s->mb_num) { + if (mb_num >= s->mb_num || !mb_num) { av_log(s->avctx, AV_LOG_ERROR, "illegal mb_num in video packet (%d %d) \n", mb_num, s->mb_num); return -1; |