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/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-05-24 00:21:21 +02:00
parent 5f91786fc8
commit ea71a48c7e
1 changed files with 2 additions and 2 deletions

View File

@ -113,10 +113,10 @@ static int update_error_limit(WavpackFrameContext *ctx)
if (ctx->stereo_in && ctx->hybrid_bitrate) {
int balance = (sl[1] - sl[0] + br[1] + 1) >> 1;
if (balance > br[0]) {
br[1] = br[0] << 1;
br[1] = br[0] * 2;
br[0] = 0;
} else if (-balance > br[0]) {
br[0] <<= 1;
br[0] *= 2;
br[1] = 0;
} else {
br[1] = br[0] + balance;