1
0
mirror of https://github.com/mstorsjo/fdk-aac.git synced 2025-02-18 12:10:38 +01:00

Integer overflow fix in InvMdctTransformLowDelay_fdk()

Bug: 112892194
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc

Change-Id: I47fdb5b51afd8c588607bf206d4ae3ef4ba1cdb3
This commit is contained in:
Fraunhofer IIS FDK 2018-08-15 14:30:40 +02:00 committed by Jean-Michel Trivi
parent b8a384b0cd
commit 24648cbd4f

View File

@ -216,6 +216,7 @@ int InvMdctTransformLowDelay_fdk(FIXP_DBL *mdctData, const int mdctData_e,
int scale = mdctData_e + MDCT_OUT_HEADROOM - int scale = mdctData_e + MDCT_OUT_HEADROOM -
LDFB_HEADROOM; /* The LDFB_HEADROOM is compensated inside LDFB_HEADROOM; /* The LDFB_HEADROOM is compensated inside
multE2_DinvF_fdk() below */ multE2_DinvF_fdk() below */
int i;
/* Select LD window slope */ /* Select LD window slope */
switch (N) { switch (N) {
@ -261,10 +262,11 @@ int InvMdctTransformLowDelay_fdk(FIXP_DBL *mdctData, const int mdctData_e,
} }
if (gain != (FIXP_DBL)0) { if (gain != (FIXP_DBL)0) {
scaleValuesWithFactor(mdctData, gain, N, scale); for (i = 0; i < N; i++) {
} else { mdctData[i] = fMult(mdctData[i], gain);
scaleValues(mdctData, N, scale); }
} }
scaleValuesSaturate(mdctData, N, scale);
/* Since all exponent and factors have been applied, current exponent is zero. /* Since all exponent and factors have been applied, current exponent is zero.
*/ */