[FFmpeg-cvslog] avcodec/ituh263dec: Avoid spending a long time in slice sync

Michael Niedermayer git at videolan.org
Thu Nov 17 14:13:47 EET 2016


ffmpeg | branch: release/3.2 | Michael Niedermayer <michael at niedermayer.cc> | Tue Nov 15 18:05:33 2016 +0100| [7e8eb30f40026e944b62bba8db187da5f9eb8b9f] | committer: Michael Niedermayer

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 at niedermayer.cc>
(cherry picked from commit 2baf36caed98cfdc7f6a2086fbf26f1a172f16cf)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=7e8eb30f40026e944b62bba8db187da5f9eb8b9f
---

 libavcodec/ituh263dec.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index a26244f..5e3c0ea 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 an infinite loop (or segfault)
     for(;left>13; left--){
         if(get_bits1(&s->gb)) break; /* Seek the '1' bit */



More information about the ffmpeg-cvslog mailing list