Browse Source

avcodec/sbrdsp_fixed: fix runtime error: left shift of 1 by 31 places cannot be represented in type 'int'

Fixes: part of 1709/clusterfuzz-testcase-minimized-4513580554649600

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 384508b2ff)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
tags/n3.3.2
Michael Niedermayer 8 years ago
parent
commit
f397613f05
1 changed files with 2 additions and 2 deletions
  1. +2
    -2
      libavcodec/sbrdsp_fixed.c

+ 2
- 2
libavcodec/sbrdsp_fixed.c View File

@@ -229,11 +229,11 @@ static void sbr_hf_gen_c(int (*X_high)[2], const int (*X_low)[2],
static void sbr_hf_g_filt_c(int (*Y)[2], const int (*X_high)[40][2], static void sbr_hf_g_filt_c(int (*Y)[2], const int (*X_high)[40][2],
const SoftFloat *g_filt, int m_max, intptr_t ixh) const SoftFloat *g_filt, int m_max, intptr_t ixh)
{ {
int m, r;
int m;
int64_t accu; int64_t accu;


for (m = 0; m < m_max; m++) { for (m = 0; m < m_max; m++) {
r = 1 << (22-g_filt[m].exp);
int64_t r = 1LL << (22-g_filt[m].exp);
accu = (int64_t)X_high[m][ixh][0] * ((g_filt[m].mant + 0x40)>>7); 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)); Y[m][0] = (int)((accu + r) >> (23-g_filt[m].exp));




Loading…
Cancel
Save