[FFmpeg-devel] [PATCH 2/2] avcodec/wavpack: Fix runtime error: left shift of negative value -14778

Michael Niedermayer michael at niedermayer.cc
Wed May 24 01:21:21 EEST 2017


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 at niedermayer.cc>
---
 libavcodec/wavpack.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/wavpack.c b/libavcodec/wavpack.c
index 1b13b676b6..c26a2c8134 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;
-- 
2.13.0



More information about the ffmpeg-devel mailing list