aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2018-08-15 14:30:40 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2018-11-28 18:09:43 -0500
commit24648cbd4f3d86d9bd487fbcad1de4f234c497f5 (patch)
tree58c094a76b32f6e2e5bbad4f5a8f14ebc6cb152e /libAACdec/src
parentb8a384b0cd7bf2447bc342f14b01eda81e6c23a6 (diff)
downloadfdk-aac-24648cbd4f3d86d9bd487fbcad1de4f234c497f5.tar.gz
fdk-aac-24648cbd4f3d86d9bd487fbcad1de4f234c497f5.tar.bz2
fdk-aac-24648cbd4f3d86d9bd487fbcad1de4f234c497f5.zip
Integer overflow fix in InvMdctTransformLowDelay_fdk()
Bug: 112892194 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I47fdb5b51afd8c588607bf206d4ae3ef4ba1cdb3
Diffstat (limited to 'libAACdec/src')
-rw-r--r--libAACdec/src/ldfiltbank.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/libAACdec/src/ldfiltbank.cpp b/libAACdec/src/ldfiltbank.cpp
index 66a5914..c7d2928 100644
--- a/libAACdec/src/ldfiltbank.cpp
+++ b/libAACdec/src/ldfiltbank.cpp
@@ -216,6 +216,7 @@ int InvMdctTransformLowDelay_fdk(FIXP_DBL *mdctData, const int mdctData_e,
int scale = mdctData_e + MDCT_OUT_HEADROOM -
LDFB_HEADROOM; /* The LDFB_HEADROOM is compensated inside
multE2_DinvF_fdk() below */
+ int i;
/* Select LD window slope */
switch (N) {
@@ -261,10 +262,11 @@ int InvMdctTransformLowDelay_fdk(FIXP_DBL *mdctData, const int mdctData_e,
}
if (gain != (FIXP_DBL)0) {
- scaleValuesWithFactor(mdctData, gain, N, scale);
- } else {
- scaleValues(mdctData, N, scale);
+ for (i = 0; i < N; i++) {
+ mdctData[i] = fMult(mdctData[i], gain);
+ }
}
+ scaleValuesSaturate(mdctData, N, scale);
/* Since all exponent and factors have been applied, current exponent is zero.
*/