]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/lossless_audiodsp: Fix undefined overflows in scalarproduct_and_madd_int16_c()
authorMichael Niedermayer <michael@niedermayer.cc>
Sun, 7 Jun 2020 17:24:10 +0000 (19:24 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Sun, 14 Jun 2020 17:17:07 +0000 (19:17 +0200)
Fixes: signed integer overflow: 2142077091 + 6881070 cannot be represented in type 'int'
Fixes: 22737/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_WMALOSSLESS_fuzzer-5958388889681920
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/lossless_audiodsp.c

index 3a9f9b20bb27a1f7d14d5167df38608b1235ac68..378165924db869e3acffeee15d8f2ae2ebec9aec 100644 (file)
@@ -27,7 +27,7 @@ static int32_t scalarproduct_and_madd_int16_c(int16_t *v1, const int16_t *v2,
                                               const int16_t *v3,
                                               int order, int mul)
 {
-    int res = 0;
+    unsigned res = 0;
 
     do {
         res   += *v1 * *v2++;