diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2019-08-09 17:09:36 +0200 |
---|---|---|
committer | Jean-Michel Trivi <jmtrivi@google.com> | 2019-10-14 15:08:34 -0700 |
commit | 6f98eab35095f5fd7bcfb9df585ff0b0c6f1460d (patch) | |
tree | b779543a4371c6bbe4d5a4a4c7070e8fb7a7f5d9 /libSBRdec/src | |
parent | a65911cd2ef6a16878e88cd91818ef962950ceec (diff) | |
download | fdk-aac-6f98eab35095f5fd7bcfb9df585ff0b0c6f1460d.tar.gz fdk-aac-6f98eab35095f5fd7bcfb9df585ff0b0c6f1460d.tar.bz2 fdk-aac-6f98eab35095f5fd7bcfb9df585ff0b0c6f1460d.zip |
Saturate shift value in calculateSbrEnvelope(). Prevents too large shift values.
Bug: 131430997
Test: atest DecoderTestXheAac ; atest DecoderTestAacDrc
Change-Id: I3331ac9bc267cd3fa4c1178bc445998869f0d99b
Diffstat (limited to 'libSBRdec/src')
-rw-r--r-- | libSBRdec/src/env_calc.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libSBRdec/src/env_calc.cpp b/libSBRdec/src/env_calc.cpp index eaf739d..c34ce96 100644 --- a/libSBRdec/src/env_calc.cpp +++ b/libSBRdec/src/env_calc.cpp @@ -1477,7 +1477,7 @@ void calculateSbrEnvelope( for (k = 0; k < noSubbands; k++) { int sc = scale_change - pNrgs->nrgGain_e[k] + (sc_change - 1); - pNrgs->nrgGain[k] >>= sc; + pNrgs->nrgGain[k] >>= fixMin(sc, DFRACT_BITS - 1); pNrgs->nrgGain_e[k] += sc; } @@ -1485,7 +1485,7 @@ void calculateSbrEnvelope( for (k = 0; k < noSubbands; k++) { int sc = scale_change - h_sbr_cal_env->filtBuffer_e[k] + (sc_change - 1); - h_sbr_cal_env->filtBuffer[k] >>= sc; + h_sbr_cal_env->filtBuffer[k] >>= fixMin(sc, DFRACT_BITS - 1); } } |