avcodec/ralf: Fix integer overflow in apply_lpc()
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 4 Aug 2019 15:20:45 +0000 (17:20 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 5 Aug 2019 15:54:24 +0000 (17:54 +0200)
Fixes: signed integer overflow: 1603085316 + 1238786562 cannot be represented in type 'int'
Fixes: 16203/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RALF_fuzzer-5086088934195200

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

index 3f7953c..0d6b57d 100644 (file)
@@ -323,7 +323,7 @@ static void apply_lpc(RALFContext *ctx, int ch, int length, int bits)
 
         acc = 0;
         for (j = 0; j < flen; j++)
-            acc += ctx->filter[j] * audio[i - j - 1];
+            acc += (unsigned)ctx->filter[j] * audio[i - j - 1];
         if (acc < 0) {
             acc = (acc + bias - 1) >> ctx->filter_bits;
             acc = FFMAX(acc, min_clip);