diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2019-10-18 14:02:58 +0200 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2019-10-18 10:56:10 -0700 |
commit | 9ba6f8b6a21cca4a4f89d0202af501fd3a67e144 (patch) | |
tree | 800aac8639b8a776cbf742acc9724eb3e90d94b9 | |
parent | a7029823f4836a4e8564b636d43e4ebd202f3ec0 (diff) | |
download | fdk-aac-9ba6f8b6a21cca4a4f89d0202af501fd3a67e144.tar.gz fdk-aac-9ba6f8b6a21cca4a4f89d0202af501fd3a67e144.tar.bz2 fdk-aac-9ba6f8b6a21cca4a4f89d0202af501fd3a67e144.zip |
Fix signed integer overflow in calcFactorPerBand() calculation.
Bug: 131430997
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I9f18f675112651be8dec5c0474601ca6531fbf15
-rw-r--r-- | libSBRdec/src/sbrdec_freq_sca.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/libSBRdec/src/sbrdec_freq_sca.cpp b/libSBRdec/src/sbrdec_freq_sca.cpp index 165f94b..e187656 100644 --- a/libSBRdec/src/sbrdec_freq_sca.cpp +++ b/libSBRdec/src/sbrdec_freq_sca.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 @@ -230,6 +230,8 @@ static UCHAR getStopBand( } } + stopMin = fMin(stopMin, 64); + /* Choose a stop band between k1 and 64 depending on stopFreq (0..13), based on a logarithmic scale. @@ -523,7 +525,8 @@ static FIXP_SGL calcFactorPerBand(int k_start, int k_stop, int num_bands) { step = FL2FXCONST_DBL(0.0f); } } - return FX_DBL2FX_SGL(bandfactor << 1); + return (bandfactor >= FL2FXCONST_DBL(0.5)) ? (FIXP_SGL)MAXVAL_SGL + : FX_DBL2FX_SGL(bandfactor << 1); } /*! |