]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/dcadsp: Fix integer overflow in dmix_add_c()
authorMichael Niedermayer <michael@niedermayer.cc>
Sat, 30 Jan 2021 18:09:36 +0000 (19:09 +0100)
committerMichael Niedermayer <michael@niedermayer.cc>
Mon, 8 Mar 2021 21:08:49 +0000 (22:08 +0100)
Fixes: signed integer overflow: 1515225320 + 759416059 cannot be represented in type 'int'
Fixes: 29256/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_DCA_fuzzer-5719088561258496
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/dcadsp.c

index faf244c8adb8d6261bd788ad4f7e071dbd7dd329..9d00ebd28142b767b4f2f7a8f37dc98ab628e1b7 100644 (file)
@@ -329,7 +329,7 @@ static void dmix_add_c(int32_t *dst, const int32_t *src, int coeff, ptrdiff_t le
     int i;
 
     for (i = 0; i < len; i++)
-        dst[i] += mul15(src[i], coeff);
+        dst[i] += (unsigned)mul15(src[i], coeff);
 }
 
 static void dmix_scale_c(int32_t *dst, int scale, ptrdiff_t len)