mirror of
https://github.com/mstorsjo/fdk-aac.git
synced 2025-06-05 22:39:13 +02:00
Fix too large shift exponent in CConcealment_InterpolateBuffer().
Bug: 146938361 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: Idb0a4e2c87962e453a991f0a573155ace6e9bf40
This commit is contained in:
committed by
Jean-Michel Trivi
parent
86f7d2b69a
commit
cee316ab3e
@@ -1228,7 +1228,6 @@ static void CConcealment_InterpolateBuffer(FIXP_DBL *spectrum,
|
|||||||
int sfb, line = 0;
|
int sfb, line = 0;
|
||||||
int fac_shift;
|
int fac_shift;
|
||||||
int fac_mod;
|
int fac_mod;
|
||||||
FIXP_DBL accu;
|
|
||||||
|
|
||||||
for (sfb = 0; sfb < sfbCnt; sfb++) {
|
for (sfb = 0; sfb < sfbCnt; sfb++) {
|
||||||
fac_shift =
|
fac_shift =
|
||||||
@@ -1236,15 +1235,11 @@ static void CConcealment_InterpolateBuffer(FIXP_DBL *spectrum,
|
|||||||
fac_mod = fac_shift & 3;
|
fac_mod = fac_shift & 3;
|
||||||
fac_shift = (fac_shift >> 2) + 1;
|
fac_shift = (fac_shift >> 2) + 1;
|
||||||
fac_shift += *pSpecScalePrv - fixMax(*pSpecScalePrv, *pSpecScaleAct);
|
fac_shift += *pSpecScalePrv - fixMax(*pSpecScalePrv, *pSpecScaleAct);
|
||||||
|
fac_shift = fMax(fMin(fac_shift, DFRACT_BITS - 1), -(DFRACT_BITS - 1));
|
||||||
|
|
||||||
for (; line < pSfbOffset[sfb + 1]; line++) {
|
for (; line < pSfbOffset[sfb + 1]; line++) {
|
||||||
accu = fMult(*(spectrum + line), facMod4Table[fac_mod]);
|
FIXP_DBL accu = fMult(*(spectrum + line), facMod4Table[fac_mod]);
|
||||||
if (fac_shift < 0) {
|
*(spectrum + line) = scaleValue(accu, fac_shift);
|
||||||
accu >>= -fac_shift;
|
|
||||||
} else {
|
|
||||||
accu <<= fac_shift;
|
|
||||||
}
|
|
||||||
*(spectrum + line) = accu;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
*pSpecScaleOut = fixMax(*pSpecScalePrv, *pSpecScaleAct);
|
*pSpecScaleOut = fixMax(*pSpecScalePrv, *pSpecScaleAct);
|
||||||
|
Reference in New Issue
Block a user