avcodec/shorten: Fix undefined shift in fix_bitshift()
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 5 Jun 2018 11:15:34 +0000 (13:15 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 7 Jun 2018 17:52:57 +0000 (19:52 +0200)
Fixes: left shift of negative value -9
Fixes: 8571/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_SHORTEN_fuzzer-5715966875926528

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/shorten.c

index f7475b4..0bd3e1e 100644 (file)
@@ -177,7 +177,7 @@ static void fix_bitshift(ShortenContext *s, int32_t *buffer)
             buffer[i] = 0;
     } else if (s->bitshift != 0) {
         for (i = 0; i < s->blocksize; i++)
-            buffer[i] <<= s->bitshift;
+            buffer[i] *= 1 << s->bitshift;
     }
 }