diff options
author | Treehugger Robot <treehugger-gerrit@google.com> | 2018-12-29 14:02:19 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2018-12-29 14:02:19 +0000 |
commit | eb9319afb2a7ed315f937de446fe7c931cc56565 (patch) | |
tree | 0fb63fe876080e8406fb05298ff7f900307794f8 | |
parent | b6222994820433062038674f5a430f20dad26186 (diff) | |
parent | f4fc574fdd957bdc222e3d28d13401748215b167 (diff) | |
download | fdk-aac-eb9319afb2a7ed315f937de446fe7c931cc56565.tar.gz fdk-aac-eb9319afb2a7ed315f937de446fe7c931cc56565.tar.bz2 fdk-aac-eb9319afb2a7ed315f937de446fe7c931cc56565.zip |
Merge "Prevent energy overflow in acelp calc_period_factor()"
-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++; } |