aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-23 01:58:48 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-08-23 13:15:18 +0200
commit7df850abf7450ccf5900cf789eeee5362a7f913e (patch)
tree1626b4cb4eaea119d06736006449c8c846514f31
parentf6ffc80bba0670182b4c17db3b98e0467048d866 (diff)
downloadffmpeg-7df850abf7450ccf5900cf789eeee5362a7f913e.tar.gz
avcodec/wavpack: Fix integer overflow
Fixes: runtime error: signed integer overflow: 227511904 + 1964113935 cannot be represented in type 'int' Fixes: 2331/clusterfuzz-testcase-minimized-6182185830711296 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 24e95f9d4de012f51fdd5767dff0b3142e13ec3a) 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 e2450aac9d..39aac18f7d 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -219,7 +219,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
INC_MED(1);
DEC_MED(2);
} else {
- base = GET_MED(0) + GET_MED(1) + GET_MED(2) * (t - 2);
+ base = GET_MED(0) + GET_MED(1) + GET_MED(2) * (t - 2U);
add = GET_MED(2) - 1;
INC_MED(0);
INC_MED(1);