diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2019-10-18 14:03:21 +0200 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2019-10-18 10:57:05 -0700 |
commit | ea9d3a049b7b3bb1a9523fe8cf79375140856359 (patch) | |
tree | 64b3cc7a895e24c4280bbcae6b5ce98e9f882978 /libAACdec/src | |
parent | 9ba6f8b6a21cca4a4f89d0202af501fd3a67e144 (diff) | |
download | fdk-aac-ea9d3a049b7b3bb1a9523fe8cf79375140856359.tar.gz fdk-aac-ea9d3a049b7b3bb1a9523fe8cf79375140856359.tar.bz2 fdk-aac-ea9d3a049b7b3bb1a9523fe8cf79375140856359.zip |
Prevent signed integer overflow in filtLP().
Bug: 131430997
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I8da32f4794274e2955936ccd42c009485fbe1972
Diffstat (limited to 'libAACdec/src')
-rw-r--r-- | libAACdec/src/usacdec_lpd.cpp | 7 |
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)); } } |