Skip to content
Snippets Groups Projects
Commit 1e443051 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

avcodec/aacdec_fixed: fix invalid shift in predict()

Fixes: runtime error: shift exponent -2 is negative
Fixes: 2818/clusterfuzz-testcase-minimized-5062943676825600

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg


Signed-off-by: default avatarMichael Niedermayer <michael@niedermayer.cc>
parent 1f53bde6
No related branches found
No related tags found
No related merge requests found
...@@ -305,8 +305,12 @@ static av_always_inline void predict(PredictorState *ps, int *coef, ...@@ -305,8 +305,12 @@ static av_always_inline void predict(PredictorState *ps, int *coef,
if (output_enable) { if (output_enable) {
int shift = 28 - pv.exp; int shift = 28 - pv.exp;
if (shift < 31) if (shift < 31) {
*coef += (pv.mant + (1 << (shift - 1))) >> shift; if (shift > 0) {
*coef += (pv.mant + (1 << (shift - 1))) >> shift;
} else
*coef += pv.mant << -shift;
}
} }
e0 = av_int2sf(*coef, 2); e0 = av_int2sf(*coef, 2);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment