summaryrefslogtreecommitdiffstats
path: root/libavcodec/aacdec_fixed.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-10-27 02:23:20 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-10-30 21:32:26 +0100
commit0976752420706c0a8b3cb8fd61497a47c7d7270f (patch)
treeb52b5342f0d262310f580a242607fa046e0fa215 /libavcodec/aacdec_fixed.c
parentf1251a6b9ccaac8a38d24398bbff156bf786717c (diff)
downloadffmpeg-streaming-0976752420706c0a8b3cb8fd61497a47c7d7270f.zip
ffmpeg-streaming-0976752420706c0a8b3cb8fd61497a47c7d7270f.tar.gz
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>
Diffstat (limited to 'libavcodec/aacdec_fixed.c')
-rw-r--r--libavcodec/aacdec_fixed.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/aacdec_fixed.c b/libavcodec/aacdec_fixed.c
index f6a5330..5e9249c 100644
--- a/libavcodec/aacdec_fixed.c
+++ b/libavcodec/aacdec_fixed.c
@@ -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);
}
}
OpenPOWER on IntegriCloud