mirror of
https://github.com/mstorsjo/fdk-aac.git
synced 2025-01-30 07:26:26 +01:00
Avoid signed integer overflow in bass_pf_1sf_delay().
Bug: 131430997 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I67bfab71987b31601a4666c8cf292f71bcb6799a
This commit is contained in:
parent
ea9d3a049b
commit
f22eb9c1fa
@ -336,17 +336,22 @@ void bass_pf_1sf_delay(
|
||||
|
||||
{
|
||||
for (i = 0; i < lg; i++) {
|
||||
/* scaled with SF_SYNTH + gain_sf + 1 */
|
||||
/* scaled with SF_SYNTH + gain_sf + 1; composition of scalefactor 2:
|
||||
* one additional shift of syn values + fMult => fMultDiv2 */
|
||||
noise_in[i] =
|
||||
(fMult(gainSGL, syn[i + i_subfr] - (syn[i + i_subfr - T] >> 1) -
|
||||
(syn[i + i_subfr + T] >> 1))) >>
|
||||
s1;
|
||||
scaleValue(fMultDiv2(gainSGL, (syn[i + i_subfr] >> 1) -
|
||||
(syn[i + i_subfr - T] >> 2) -
|
||||
(syn[i + i_subfr + T] >> 2)),
|
||||
2 - s1);
|
||||
}
|
||||
|
||||
for (i = lg; i < L_SUBFR; i++) {
|
||||
/* scaled with SF_SYNTH + gain_sf + 1 */
|
||||
/* scaled with SF_SYNTH + gain_sf + 1; composition of scalefactor 2:
|
||||
* one additional shift of syn values + fMult => fMultDiv2 */
|
||||
noise_in[i] =
|
||||
(fMult(gainSGL, syn[i + i_subfr] - syn[i + i_subfr - T])) >> s1;
|
||||
scaleValue(fMultDiv2(gainSGL, (syn[i + i_subfr] >> 1) -
|
||||
(syn[i + i_subfr - T] >> 1)),
|
||||
2 - s1);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user