aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-08-26 02:26:24 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2018-11-18 02:35:03 +0100
commita90f6d3e908b4cfff1387316131a5ac476dbb6d6 (patch)
tree27e84b36b3413eb9ed451cd21b8637c935a44d32
parenta72d42b80ff4a9220cb20b2231d55ada0d6b0b3b (diff)
downloadffmpeg-a90f6d3e908b4cfff1387316131a5ac476dbb6d6.tar.gz
avcodec/ra144: Fix undefined integer overflow in add_wav()
Fixes: signed integer overflow: -26884 * 91439 cannot be represented in type 'int' Fixes: 9687/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_RA_144_fuzzer-4995588121690112 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 93a203662f6ff1bb9fd2e966bf7df27e9bdb1916) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ra144.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c
index cf8127c236..573703d70b 100644
--- a/libavcodec/ra144.c
+++ b/libavcodec/ra144.c
@@ -1516,7 +1516,7 @@ static void add_wav(int16_t *dest, int n, int skip_first, int *m,
if (v[0]) {
for (i=0; i < BLOCKSIZE; i++)
- dest[i] = (s1[i]*v[0] + s2[i]*v[1] + s3[i]*v[2]) >> 12;
+ dest[i] = ((int)(s1[i]*(unsigned)v[0]) + s2[i]*v[1] + s3[i]*v[2]) >> 12;
} else {
for (i=0; i < BLOCKSIZE; i++)
dest[i] = ( s2[i]*v[1] + s3[i]*v[2]) >> 12;