[FFmpeg-cvslog] avcodec/ituh263dec: Check for the bitstream end in ff_h263_decode_mb()

Michael Niedermayer git at videolan.org
Sun Feb 26 18:16:52 EET 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Sat Feb 25 21:07:23 2017 +0100| [0716bcce5bdc6299da2966f34cb62eba3f709be8] | committer: Michael Niedermayer

avcodec/ituh263dec: Check for the bitstream end in ff_h263_decode_mb()

Fixes invalid shift

Fixes: 670/clusterfuzz-testcase-4852021066727424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

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

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

diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index 09b6a2f..e393388 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -962,6 +962,9 @@ intra:
     }
 end:
 
+    if (get_bits_left(&s->gb) < 0)
+        return AVERROR_INVALIDDATA;
+
         /* per-MB end of slice check */
     {
         int v= show_bits(&s->gb, 16);



More information about the ffmpeg-cvslog mailing list