avcodec/ituh263dec: Check for the bitstream end in ff_h263_decode_mb()
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 25 Feb 2017 20:07:23 +0000 (21:07 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 26 Feb 2017 16:16:22 +0000 (17:16 +0100)
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@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/ituh263dec.c

index 09b6a2f..e393388 100644 (file)
@@ -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);