Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-11-01 16:00:20 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2018-01-09 01:19:14 +0300
commit4730046891069c80bdcf773972d2c91f1dc31327 (patch)
treecfd48560cb448e0b54ff0e178a1d43d04f642ea5
parent4e87ab803ad53168dce5beb78e0e0cc6995c4a04 (diff)
avcodec/sbrdsp_fixed: Fix integer overflow in shift in sbr_hf_g_filt_c()
Fixes: runtime error: shift exponent 66 is too large for 64-bit type 'long long' Fixes: 3642/clusterfuzz-testcase-minimized-5443853801750528 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 981e99ab99986935affad7c164ebdfe28e8ea7f8) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/sbrdsp_fixed.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/libavcodec/sbrdsp_fixed.c b/libavcodec/sbrdsp_fixed.c
index f45bb847a8..07ef12117c 100644
--- a/libavcodec/sbrdsp_fixed.c
+++ b/libavcodec/sbrdsp_fixed.c
@@ -233,12 +233,14 @@ static void sbr_hf_g_filt_c(int (*Y)[2], const int (*X_high)[40][2],
int64_t accu;
for (m = 0; m < m_max; m++) {
- int64_t r = 1LL << (22-g_filt[m].exp);
- accu = (int64_t)X_high[m][ixh][0] * ((g_filt[m].mant + 0x40)>>7);
- Y[m][0] = (int)((accu + r) >> (23-g_filt[m].exp));
+ if (22 - g_filt[m].exp < 61) {
+ int64_t r = 1LL << (22-g_filt[m].exp);
+ accu = (int64_t)X_high[m][ixh][0] * ((g_filt[m].mant + 0x40)>>7);
+ Y[m][0] = (int)((accu + r) >> (23-g_filt[m].exp));
- accu = (int64_t)X_high[m][ixh][1] * ((g_filt[m].mant + 0x40)>>7);
- Y[m][1] = (int)((accu + r) >> (23-g_filt[m].exp));
+ accu = (int64_t)X_high[m][ixh][1] * ((g_filt[m].mant + 0x40)>>7);
+ Y[m][1] = (int)((accu + r) >> (23-g_filt[m].exp));
+ }
}
}