mirror of https://git.ffmpeg.org/ffmpeg.git
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:
parent
5f91786fc8
commit
ea71a48c7e
|
@ -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;
|
||||||
|
|
Loading…
Reference in New Issue