Commit 05f4703a authored by Michael Niedermayer's avatar Michael Niedermayer

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: 's avatarKieran Kunhya <kieran618@googlemail.com>
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 4e3e8980
......@@ -465,7 +465,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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment