[FFmpeg-devel] [PATCH 3/4] avcodec/aacdec_fixed: Fix undefined shift

Michael Niedermayer michael at niedermayer.cc
Sun Nov 5 22:20:07 EET 2017


Fixes: runtime error: left shift of negative value -801112064
Fixes: 3492/clusterfuzz-testcase-minimized-5784775283441664

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/aacdec_fixed.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c
index ffd577c789..f96999efb4 100644
--- a/libavcodec/aacdec_fixed.c
+++ b/libavcodec/aacdec_fixed.c
@@ -309,7 +309,7 @@ static av_always_inline void predict(PredictorState *ps, int *coef,
             if (shift > 0) {
                 *coef += (unsigned)((pv.mant + (1 << (shift - 1))) >> shift);
             } else
-                *coef += (unsigned)(pv.mant << -shift);
+                *coef += (unsigned)pv.mant << -shift;
         }
     }
 
-- 
2.15.0



More information about the ffmpeg-devel mailing list