aboutsummaryrefslogtreecommitdiffstats
path: root/libSBRdec
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2018-12-27 19:14:22 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2018-12-27 19:14:22 +0000
commitf828d3e16adfb4cb428b4f3a2c155f89853cebbe (patch)
tree8e32ae3bb3101c49774e7071aa541feda2ca89c6 /libSBRdec
parentcfc66160486e9845df39278bdb0877f87f72bb27 (diff)
parent29b81acd78887b24c2995f89c7c34e1861afad69 (diff)
downloadfdk-aac-f828d3e16adfb4cb428b4f3a2c155f89853cebbe.tar.gz
fdk-aac-f828d3e16adfb4cb428b4f3a2c155f89853cebbe.tar.bz2
fdk-aac-f828d3e16adfb4cb428b4f3a2c155f89853cebbe.zip
Merge "Limit too large shift exponent in apply_inter_tes()"
Diffstat (limited to 'libSBRdec')
-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);