summaryrefslogtreecommitdiffstats
path: root/libavcodec/ituh263dec.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-24 00:42:04 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-10-08 16:24:58 +0200
commit7f0498ed461987b62bb97ff6463b4df108d60d78 (patch)
treea61b3226e5e90b2589611193142929affdc4c80a /libavcodec/ituh263dec.c
parent4a660fac9899191d4121cde02f2a98977b1303b6 (diff)
downloadffmpeg-streaming-7f0498ed461987b62bb97ff6463b4df108d60d78.zip
ffmpeg-streaming-7f0498ed461987b62bb97ff6463b4df108d60d78.tar.gz
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>
Diffstat (limited to 'libavcodec/ituh263dec.c')
-rw-r--r--libavcodec/ituh263dec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index c37f872..c1005b0 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -1218,6 +1218,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;
OpenPOWER on IntegriCloud