aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2018-12-27 11:28:53 -0800
committerandroid-build-merger <android-build-merger@google.com>2018-12-27 11:28:53 -0800
commitcce1e2106d431a65c02e056839b6b0a6aff50085 (patch)
tree3e39506b58cdea6e72e11f911af8587909627c6c
parentd8be06332296042e89f1663b880151a6d707b664 (diff)
parent2027969e1f72be4464e48f1bc0065b2bed1590b9 (diff)
downloadfdk-aac-cce1e2106d431a65c02e056839b6b0a6aff50085.tar.gz
fdk-aac-cce1e2106d431a65c02e056839b6b0a6aff50085.tar.bz2
fdk-aac-cce1e2106d431a65c02e056839b6b0a6aff50085.zip
Merge "Limit too large shift exponent in apply_inter_tes()" am: f828d3e16a
am: 2027969e1f Change-Id: I1c13d0a0fbbeb5c937e3e1391f0974e5caf76a20
-rw-r--r--libSBRdec/src/env_calc.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/libSBRdec/src/env_calc.cpp b/libSBRdec/src/env_calc.cpp
index 10c73ec..cb1474f 100644
--- a/libSBRdec/src/env_calc.cpp
+++ b/libSBRdec/src/env_calc.cpp
@@ -626,7 +626,8 @@ static void apply_inter_tes(FIXP_DBL **qmfReal, FIXP_DBL **qmfImag,
total_power_low >>= diff;
total_power_low_sf = new_summand_sf;
} else if (new_summand_sf < total_power_low_sf) {
- new_summand >>= total_power_low_sf - new_summand_sf;
+ new_summand >>=
+ fMin(DFRACT_BITS - 1, total_power_low_sf - new_summand_sf);
}
total_power_low += (new_summand >> preShift2);
@@ -638,7 +639,8 @@ static void apply_inter_tes(FIXP_DBL **qmfReal, FIXP_DBL **qmfImag,
fMin(DFRACT_BITS - 1, new_summand_sf - total_power_high_sf);
total_power_high_sf = new_summand_sf;
} else if (new_summand_sf < total_power_high_sf) {
- new_summand >>= total_power_high_sf - new_summand_sf;
+ new_summand >>=
+ fMin(DFRACT_BITS - 1, total_power_high_sf - new_summand_sf);
}
total_power_high += (new_summand >> preShift2);