mirror of https://git.ffmpeg.org/ffmpeg.git
avcodec/aacdec_fixed: Handle more extreem cases in noise_scale()
Its unclear if these cases have any relevance in real files Fixes: shift exponent -2 is negative Fixes: 14489/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_AAC_FIXED_fuzzer-5681941631729664 Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
bc33c99d56
commit
3d14663f83
|
@ -221,10 +221,15 @@ static void noise_scale(int *coefs, int scale, int band_energy, int len)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
s = s + 32;
|
s = s + 32;
|
||||||
round = s ? 1 << (s-1) : 0;
|
if (s > 0) {
|
||||||
for (i=0; i<len; i++) {
|
round = 1 << (s-1);
|
||||||
out = (int)((int64_t)((int64_t)coefs[i] * c + round) >> s);
|
for (i=0; i<len; i++) {
|
||||||
coefs[i] = -out;
|
out = (int)((int64_t)((int64_t)coefs[i] * c + round) >> s);
|
||||||
|
coefs[i] = -out;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
for (i=0; i<len; i++)
|
||||||
|
coefs[i] = -(int64_t)coefs[i] * c * (1 << -s);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue