[FFmpeg-devel] [PATCH 2/5] avcodec/ituh263dec: Check for the bitstream end in ff_h263_decode_mb()

Michael Niedermayer michael at niedermayer.cc
Sat Feb 25 22:07:23 EET 2017


Fixes invalid shift

Fixes: 670/clusterfuzz-testcase-4852021066727424

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavcodec/ituh263dec.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index 09b6a2f17d..e39338870f 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);
-- 
2.11.0



More information about the ffmpeg-devel mailing list