diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-24 00:21:21 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2017-05-25 14:29:54 +0200 |
commit | ea71a48c7e8a76ee447fa518cca087df9288288d (patch) | |
tree | c450c15446d0569b5865eea4cdab625704bf1c39 | |
parent | 5f91786fc8ad9b4108e09e6cbf119d95c8ac4db7 (diff) | |
download | ffmpeg-ea71a48c7e8a76ee447fa518cca087df9288288d.tar.gz |
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>
-rw-r--r-- | libavcodec/wavpack.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c index 20774e61d2..3b3c6b2d16 100644 --- a/libavcodec/wavpack.c +++ b/libavcodec/wavpack.c @@ -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; |