1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

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@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2017-10-27 02:23:20 +02:00
parent f1251a6b9c
commit 0976752420

View File

@ -307,9 +307,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);
}
}