aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2016-11-15 18:05:33 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2016-11-26 15:12:27 +0100
commit1e86f1a64690eeb132c56815917ea66ce90546cc (patch)
tree60661d4e4cf1f878e5c31ed64772585ff8e9c70b
parentecc5bada26f262b77d157c1f557bc78978b9dbff (diff)
downloadffmpeg-1e86f1a64690eeb132c56815917ea66ce90546cc.tar.gz
avcodec/ituh263dec: Avoid spending a long time in slice sync
Fixes: 177/fuzz-3-ffmpeg_VIDEO_AV_CODEC_ID_FLV1_fuzzer Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 2baf36caed98cfdc7f6a2086fbf26f1a172f16cf) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ituh263dec.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index 2e449f8eeb..42ec1f61cf 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -167,6 +167,7 @@ static int h263_decode_gob_header(MpegEncContext *s)
/* We have a GBSC probably with GSTUFF */
skip_bits(&s->gb, 16); /* Drop the zeros */
left= get_bits_left(&s->gb);
+ left = FFMIN(left, 32);
//MN: we must check the bits left or we might end in a infinite loop (or segfault)
for(;left>13; left--){
if(get_bits1(&s->gb)) break; /* Seek the '1' bit */