diff options
author | Fraunhofer IIS FDK <audio-fdk@iis.fraunhofer.de> | 2018-12-29 06:11:42 -0800 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2018-12-29 06:11:42 -0800 |
commit | 196f1ce4841e220e4785b853f284a451ce22dc7c (patch) | |
tree | 0fb63fe876080e8406fb05298ff7f900307794f8 /libAACdec | |
parent | ffb999bec41745ddd3638073d4facfc8c93d36f4 (diff) | |
parent | eb9319afb2a7ed315f937de446fe7c931cc56565 (diff) | |
download | fdk-aac-196f1ce4841e220e4785b853f284a451ce22dc7c.tar.gz fdk-aac-196f1ce4841e220e4785b853f284a451ce22dc7c.tar.bz2 fdk-aac-196f1ce4841e220e4785b853f284a451ce22dc7c.zip |
Merge "Prevent energy overflow in acelp calc_period_factor()"
am: eb9319afb2
Change-Id: Ic02c1abe8a36b5860242a8a475a68c3012c3873d
Diffstat (limited to 'libAACdec')
-rw-r--r-- | libAACdec/src/usacdec_acelp.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libAACdec/src/usacdec_acelp.cpp b/libAACdec/src/usacdec_acelp.cpp index 9fecebf..c836c6a 100644 --- a/libAACdec/src/usacdec_acelp.cpp +++ b/libAACdec/src/usacdec_acelp.cpp @@ -309,7 +309,7 @@ static FIXP_DBL calc_period_factor(FIXP_DBL exc[], FIXP_SGL gain_pit, ener_exc = (FIXP_DBL)0; for (int i = 0; i < L_SUBFR; i++) { ener_exc += fPow2Div2(exc[i]) >> s; - if (ener_exc > FL2FXCONST_DBL(0.5f)) { + if (ener_exc >= FL2FXCONST_DBL(0.5f)) { ener_exc >>= 1; s++; } |