summaryrefslogtreecommitdiff
path: root/libAACdec
diff options
context:
space:
mode:
authorFraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de>2019-10-18 14:03:21 +0200
committerJean-Michel Trivi <jmtrivi@google.com>2019-10-18 10:57:05 -0700
commitea9d3a049b7b3bb1a9523fe8cf79375140856359 (patch)
tree64b3cc7a895e24c4280bbcae6b5ce98e9f882978 /libAACdec
parent9ba6f8b6a21cca4a4f89d0202af501fd3a67e144 (diff)
downloadaac-ea9d3a049b7b3bb1a9523fe8cf79375140856359.tar.gz
Prevent signed integer overflow in filtLP().
Bug: 131430997 Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc Change-Id: I8da32f4794274e2955936ccd42c009485fbe1972
Diffstat (limited to 'libAACdec')
-rw-r--r--libAACdec/src/usacdec_lpd.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/libAACdec/src/usacdec_lpd.cpp b/libAACdec/src/usacdec_lpd.cpp
index e0a2631..fa68ccb 100644
--- a/libAACdec/src/usacdec_lpd.cpp
+++ b/libAACdec/src/usacdec_lpd.cpp
@@ -1,7 +1,7 @@
/* -----------------------------------------------------------------------------
Software License for The Fraunhofer FDK AAC Codec Library for Android
-© Copyright 1995 - 2018 Fraunhofer-Gesellschaft zur Förderung der angewandten
+© Copyright 1995 - 2019 Fraunhofer-Gesellschaft zur Förderung der angewandten
Forschung e.V. All rights reserved.
1. INTRODUCTION
@@ -130,9 +130,10 @@ void filtLP(const FIXP_DBL *syn, FIXP_PCM *syn_out, FIXP_DBL *noise,
for (i = 0; i < stop; i++) {
tmp = fMultDiv2(noise[i], filt[0]); // Filt in Q-1.16
for (j = 1; j <= len; j++) {
- tmp += fMultDiv2((noise[i - j] + noise[i + j]), filt[j]);
+ tmp += fMult((noise[i - j] >> 1) + (noise[i + j] >> 1), filt[j]);
}
- syn_out[i] = (FIXP_PCM)(IMDCT_SCALE(syn[i] - tmp));
+ syn_out[i] = (FIXP_PCM)(SATURATE_SHIFT(
+ (syn[i] >> 1) - (tmp >> 1), (MDCT_OUTPUT_SCALE - 1), PCM_OUT_BITS));
}
}