Commit ea71a48c authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/wavpack: Fix runtime error: left shift of negative value -14778

Fixes: 1778/clusterfuzz-testcase-minimized-5128953268273152

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 5f91786f
...@@ -113,10 +113,10 @@ static int update_error_limit(WavpackFrameContext *ctx) ...@@ -113,10 +113,10 @@ static int update_error_limit(WavpackFrameContext *ctx)
if (ctx->stereo_in && ctx->hybrid_bitrate) { if (ctx->stereo_in && ctx->hybrid_bitrate) {
int balance = (sl[1] - sl[0] + br[1] + 1) >> 1; int balance = (sl[1] - sl[0] + br[1] + 1) >> 1;
if (balance > br[0]) { if (balance > br[0]) {
br[1] = br[0] << 1; br[1] = br[0] * 2;
br[0] = 0; br[0] = 0;
} else if (-balance > br[0]) { } else if (-balance > br[0]) {
br[0] <<= 1; br[0] *= 2;
br[1] = 0; br[1] = 0;
} else { } else {
br[1] = br[0] + balance; br[1] = br[0] + balance;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment