aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-30 03:09:11 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-31 02:43:29 +0200
commitd542185e054192fb3028512c0dae2187cf29607e (patch)
treef56dcdb4a004ba714c73ed245a61478b0177e95b
parentc92acd5ed48d3931dbbc77329b6aebaacc097184 (diff)
downloadffmpeg-d542185e054192fb3028512c0dae2187cf29607e.tar.gz
avcodec/wavpack: Fix runtime error: signed integer overflow: 24 * -2147483648 cannot be represented in type 'int'
Fixes: 1894/clusterfuzz-testcase-minimized-4716739789062144 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 d90c5bf10559554d6f9cd1dfb90767b991b76d5d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wavpack.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index f828fc725b..a679d424eb 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -548,7 +548,7 @@ static inline int wv_unpack_mono(WavpackFrameContext *s, GetBitContext *gb,
if (type != AV_SAMPLE_FMT_S16P)
S = T + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10);
else
- S = T + ((s->decorr[i].weightA * A + 512) >> 10);
+ S = T + ((int)(s->decorr[i].weightA * (unsigned)A + 512) >> 10);
if (A && T)
s->decorr[i].weightA -= ((((T ^ A) >> 30) & 2) - 1) * s->decorr[i].delta;
s->decorr[i].samplesA[j] = T = S;