aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-19 12:25:52 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-06-02 01:14:38 +0200
commitf3b6ea14081a696d6ece566c403ae55d8109ddb0 (patch)
tree70ef33ef7b1805a3b9ce7f69455355df8a0d1ffd
parente46bc3052dc1286c5430a35f2259a09812d8ad7d (diff)
downloadffmpeg-f3b6ea14081a696d6ece566c403ae55d8109ddb0.tar.gz
avcodec/aacsbr_fixed: Fix multiple runtime error: shift exponent 150 is too large for 32-bit type 'int'
Fixes: 1681/clusterfuzz-testcase-minimized-5970545365483520 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 3fb104f4476ad238e2ca768e9b80dc314e6e856d) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/aacsbr_fixed.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavcodec/aacsbr_fixed.c b/libavcodec/aacsbr_fixed.c
index b26314a7eb..480062dfcc 100644
--- a/libavcodec/aacsbr_fixed.c
+++ b/libavcodec/aacsbr_fixed.c
@@ -288,6 +288,8 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
shift = a00.exp;
if (shift >= 3)
alpha0[k][0] = 0x7fffffff;
+ else if (shift <= -30)
+ alpha0[k][0] = 0;
else {
a00.mant <<= 1;
shift = 2-shift;
@@ -302,6 +304,8 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
shift = a01.exp;
if (shift >= 3)
alpha0[k][1] = 0x7fffffff;
+ else if (shift <= -30)
+ alpha0[k][1] = 0;
else {
a01.mant <<= 1;
shift = 2-shift;
@@ -315,6 +319,8 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
shift = a10.exp;
if (shift >= 3)
alpha1[k][0] = 0x7fffffff;
+ else if (shift <= -30)
+ alpha1[k][0] = 0;
else {
a10.mant <<= 1;
shift = 2-shift;
@@ -329,6 +335,8 @@ static void sbr_hf_inverse_filter(SBRDSPContext *dsp,
shift = a11.exp;
if (shift >= 3)
alpha1[k][1] = 0x7fffffff;
+ else if (shift <= -30)
+ alpha1[k][1] = 0;
else {
a11.mant <<= 1;
shift = 2-shift;