aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-06-01 18:48:37 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-16 01:05:29 +0200
commitb7afa9f8aad0da942e7a528faadba6285596e234 (patch)
tree7228024c454017ec8b3479c6819c2e4372ccc2dc
parenta8643da03a98562d4ea3a687beac486677e93916 (diff)
downloadffmpeg-b7afa9f8aad0da942e7a528faadba6285596e234.tar.gz
avcodec/wavpack: Fix runtime error: shift exponent 32 is too large for 32-bit type 'int'
Fixes: 1967/clusterfuzz-testcase-minimized-5757031199801344 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 8b3e580b7f436206e84dac89415e057fa9abdab8) 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 a0f5d509bc..72d5613363 100644
--- a/libavcodec/wavpack.c
+++ b/libavcodec/wavpack.c
@@ -184,7 +184,7 @@ static int wv_get_value(WavpackFrameContext *ctx, GetBitContext *gb,
goto error;
t += t2;
} else {
- if (get_bits_left(gb) < t2 - 1)
+ if (t2 >= 32 || get_bits_left(gb) < t2 - 1)
goto error;
t += get_bits_long(gb, t2 - 1) | (1 << (t2 - 1));
}