aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-31 22:53:02 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-04 00:29:42 +0200
commitecc3fe3859f3f924eb9f841fd0cc5c42d9636a8b (patch)
treec51275b54e71a561640dcdcd62c889ab016c8d1a
parent9d8c59ce507a7bb3833695435b1cf5c6762441b2 (diff)
downloadffmpeg-ecc3fe3859f3f924eb9f841fd0cc5c42d9636a8b.tar.gz
avcodec/wavpack: Fix runtime error: signed integer overflow: 2013265955 - -134217694 cannot be represented in type 'int'
Fixes: 1922/clusterfuzz-testcase-minimized-5561194112876544 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 a47273c803edfbc43793349b74429ae29b05c003) 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 3bc345e797..9ce074d975 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -239,7 +239,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
if (get_bits_left(gb) <= 0)
goto error;
if (get_bits1(gb)) {
- add -= (mid - base);
+ add -= (mid - (unsigned)base);
base = mid;
} else
add = mid - base - 1;