[FFmpeg-cvslog] avcodec/aacdec_fixed: Fix integer overflow in predict()

Michael Niedermayer git at videolan.org
Thu Feb 1 01:51:03 EET 2018


ffmpeg | branch: release/2.8 | Michael Niedermayer <michael at niedermayer.cc> | Fri Oct 27 02:23:20 2017 +0200| [9ef0472b265abd2aa38a33145e3a618307e05bb0] | committer: Michael Niedermayer

avcodec/aacdec_fixed: Fix integer overflow in predict()

Fixes: runtime error: signed integer overflow: -2110708110 + -82837504 cannot be represented in type 'int'
Fixes: 3547/clusterfuzz-testcase-minimized-6009386439802880

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit 0976752420706c0a8b3cb8fd61497a47c7d7270f)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=9ef0472b265abd2aa38a33145e3a618307e05bb0
---

 libavcodec/aacdec_fixed.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c
index 8f2fcd214b..81dcafa7a9 100644
--- a/libavcodec/aacdec_fixed.c
+++ b/libavcodec/aacdec_fixed.c
@@ -306,9 +306,9 @@ static av_always_inline void predict(PredictorState *ps, int *coef,
 
         if (shift < 31) {
             if (shift > 0) {
-                *coef += (pv.mant + (1 << (shift - 1))) >> shift;
+                *coef += (unsigned)((pv.mant + (1 << (shift - 1))) >> shift);
             } else
-                *coef += pv.mant << -shift;
+                *coef += (unsigned)(pv.mant << -shift);
         }
     }
 



More information about the ffmpeg-cvslog mailing list