aboutsummaryrefslogtreecommitdiffstats
path: root/libAACdec/src/usacdec_lpc.cpp
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2019-09-20 14:03:40 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2019-10-15 15:50:10 -0700
commit2152ae1a5ef0511e0b38a981745eb910f2af9bca (patch)
tree8b52c5f90cb1e600434cb98198025c7b2afa37b6 /libAACdec/src/usacdec_lpc.cpp
parent3c377e33055267a007566a550820ae1cdb135331 (diff)
downloadfdk-aac-2152ae1a5ef0511e0b38a981745eb910f2af9bca.tar.gz
fdk-aac-2152ae1a5ef0511e0b38a981745eb910f2af9bca.tar.bz2
fdk-aac-2152ae1a5ef0511e0b38a981745eb910f2af9bca.zip
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
Diffstat (limited to 'libAACdec/src/usacdec_lpc.cpp')
-rw-r--r--libAACdec/src/usacdec_lpc.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libAACdec/src/usacdec_lpc.cpp b/libAACdec/src/usacdec_lpc.cpp
index d726798..88601b7 100644
--- a/libAACdec/src/usacdec_lpc.cpp
+++ b/libAACdec/src/usacdec_lpc.cpp
@@ -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;