Browse Source

avcodec/ituh263dec: Check input for minimal frame size

Fixes: Timeout (28sec -> 3sec)
Fixes: 17559/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_H263_fuzzer-5681050776240128

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 7f0498ed46)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.2.15
Michael Niedermayer 6 years ago
parent
commit
e6431d2c2c
1 changed files with 5 additions and 0 deletions
  1. +5
    -0
      libavcodec/ituh263dec.c

+ 5
- 0
libavcodec/ituh263dec.c View File

@@ -1089,6 +1089,11 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
if ((ret = av_image_check_size(s->width, s->height, 0, s)) < 0)
return ret;

if (!(s->avctx->flags2 & AV_CODEC_FLAG2_CHUNKS)) {
if ((s->width * s->height / 256 / 8) > get_bits_left(&s->gb))
return AVERROR_INVALIDDATA;
}

s->mb_width = (s->width + 15) / 16;
s->mb_height = (s->height + 15) / 16;
s->mb_num = s->mb_width * s->mb_height;


Loading…
Cancel
Save