1
0
mirror of https://github.com/mstorsjo/fdk-aac.git synced 2025-01-20 19:10:44 +01:00

Suppress integer overflow in lsf_weight_2st() by using 64 bit multiplication with explicit 32 bit integer result.

Bug: 131430997
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I82ce4858688e90abee0c44c4ada34a9a7b08342f
This commit is contained in:
Fraunhofer IIS FDK 2019-09-20 14:03:40 +02:00 committed by Jean-Michel Trivi
parent 3c377e3305
commit 2152ae1a5e

View File

@ -565,7 +565,8 @@ static void lsf_weight_2st(FIXP_LPC *lsfq, FIXP_DBL *xq, int nk_mode) {
/* add non-weighted residual LSF vector to LSF1st */
for (i = 0; i < M_LP_FILTER_ORDER; i++) {
w = (LONG)fMultDiv2(factor, sqrtFixp(fMult(d[i], d[i + 1])));
lsfq[i] = fAddSaturate(lsfq[i], FX_DBL2FX_LPC((FIXP_DBL)(w * (LONG)xq[i])));
lsfq[i] = fAddSaturate(lsfq[i],
FX_DBL2FX_LPC((FIXP_DBL)((INT64)w * (LONG)xq[i])));
}
return;