]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/rv10: Avoid calculating undefined value that is unused
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 16 Jun 2019 10:52:30 +0000 (12:52 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 26 Jun 2019 19:25:50 +0000 (21:25 +0200)
Fixes: shift exponent 64 is too large for 32-bit type 'int'
Fixes: 15253/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RV10_fuzzer-5671114300194816
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/rv10.c

index 595e2175190abc17656c932f6f2c5df877b34327..8f4497b9e0f3b58137ce6b5cd6aeb5342e8adc01 100644 (file)
@@ -646,7 +646,7 @@ static int rv10_decode_packet(AVCodecContext *avctx, const uint8_t *buf,
 
         // Repeat the slice end check from ff_h263_decode_mb with our active
         // bitstream size
-        if (ret != SLICE_ERROR) {
+        if (ret != SLICE_ERROR && active_bits_size >= get_bits_count(&s->gb)) {
             int v = show_bits(&s->gb, 16);
 
             if (get_bits_count(&s->gb) + 16 > active_bits_size)