diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2019-10-29 13:09:09 +0100 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2019-12-27 10:20:36 -0800 |
commit | 801b45ffab8c3ac50c620fd5c6a5818782d2f889 (patch) | |
tree | 76a8e363eb20625a6a4abd536e8c267eac731021 | |
parent | c69e4584c375e1426b2c93249197a5b6c9385daf (diff) | |
download | fdk-aac-801b45ffab8c3ac50c620fd5c6a5818782d2f889.tar.gz fdk-aac-801b45ffab8c3ac50c620fd5c6a5818782d2f889.tar.bz2 fdk-aac-801b45ffab8c3ac50c620fd5c6a5818782d2f889.zip |
Adjust scaling in lppTransposerHBE() to prevent signed integer overflow in autocorrelation.
Bug: 145669291
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: Ia32b081b982d6886f51642a7ed1ca73acb40dac9
-rw-r--r-- | libSBRdec/src/lpp_tran.cpp | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/libSBRdec/src/lpp_tran.cpp b/libSBRdec/src/lpp_tran.cpp index 6acb626..93e1158 100644 --- a/libSBRdec/src/lpp_tran.cpp +++ b/libSBRdec/src/lpp_tran.cpp @@ -1014,8 +1014,8 @@ void lppTransposerHBE( pSettings->nCols) + lowBandShift); - dynamicScale = fixMax( - 0, dynamicScale - 1); /* one additional bit headroom to prevent -1.0 */ + dynamicScale = + dynamicScale - 1; /* one additional bit headroom to prevent -1.0 */ /* Scale temporal QMF buffer. @@ -1194,6 +1194,9 @@ void lppTransposerHBE( } else { /* bw <= 0 */ int descale = fixMin(DFRACT_BITS - 1, (LPC_SCALE_FACTOR + dynamicScale)); + dynamicScale += + 1; /* prevent negativ scale factor due to 'one additional bit + headroom' */ for (i = startSample; i < stopSample; i++) { FIXP_DBL accu1, accu2; @@ -1210,9 +1213,9 @@ void lppTransposerHBE( dynamicScale; qmfBufferReal[i][loBand] = - (lowBandReal[LPC_ORDER + i] >> descale) + (accu1 << 1); + (lowBandReal[LPC_ORDER + i] >> descale) + (accu1 << (1 + 1)); qmfBufferImag[i][loBand] = - (lowBandImag[LPC_ORDER + i] >> descale) + (accu2 << 1); + (lowBandImag[LPC_ORDER + i] >> descale) + (accu2 << (1 + 1)); } } /* bw <= 0 */ |