aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-10 23:28:21 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-13 18:06:11 +0200
commit48f7757749564dac8ad68d11fca13d0739aa2304 (patch)
treebedf027168258bd6fcfd27ee535acdba6adc6cc1
parent2171dfae8c065878a2e130390eb78cf2947a5b69 (diff)
downloadffmpeg-48f7757749564dac8ad68d11fca13d0739aa2304.tar.gz
avcodec/wavpack: Fix runtime error: signed integer overflow: 2147483642 + 512 cannot be represented in type 'int'
Fixed: 1453/clusterfuzz-testcase-minimized-5024976874766336 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/wavpack.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index d2ba97ee2c..87c065c1e7 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -433,8 +433,8 @@ static inline int wv_unpack_stereo(WavpackFrameContext *s, GetBitContext *gb,
L2 = L + ((s->decorr[i].weightA * (int64_t)A + 512) >> 10);
R2 = R + ((s->decorr[i].weightB * (int64_t)B + 512) >> 10);
} else {
- L2 = L + ((s->decorr[i].weightA * A + 512) >> 10);
- R2 = R + ((s->decorr[i].weightB * B + 512) >> 10);
+ L2 = L + ((int)(s->decorr[i].weightA * A + 512U) >> 10);
+ R2 = R + ((int)(s->decorr[i].weightB * B + 512U) >> 10);
}
if (A && L)
s->decorr[i].weightA -= ((((L ^ A) >> 30) & 2) - 1) * s->decorr[i].delta;