Commit ea59ef0c authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/dss_sp: Fix multiple runtime error: signed integer overflow: -15699 *...

avcodec/dss_sp: Fix multiple runtime error: signed integer overflow: -15699 * -164039 cannot be represented in type 'int'

Fixed: 1409/clusterfuzz-testcase-minimized-5237365020819456

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpegSigned-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 0075d9ec
...@@ -33,7 +33,7 @@ ...@@ -33,7 +33,7 @@
#define DSS_SP_FRAME_SIZE 42 #define DSS_SP_FRAME_SIZE 42
#define DSS_SP_SAMPLE_COUNT (66 * SUBFRAMES) #define DSS_SP_SAMPLE_COUNT (66 * SUBFRAMES)
#define DSS_SP_FORMULA(a, b, c) (((((a) * (1 << 15)) + (b) * (c)) + 0x4000) >> 15) #define DSS_SP_FORMULA(a, b, c) ((int)((((a) * (1 << 15)) + (b) * (unsigned)(c)) + 0x4000) >> 15)
typedef struct DssSpSubframe { typedef struct DssSpSubframe {
int16_t gain; int16_t gain;
...@@ -524,7 +524,7 @@ static void dss_sp_shift_sq_sub(const int32_t *filter_buf, ...@@ -524,7 +524,7 @@ static void dss_sp_shift_sq_sub(const int32_t *filter_buf,
tmp = dst[a] * filter_buf[0]; tmp = dst[a] * filter_buf[0];
for (i = 14; i > 0; i--) for (i = 14; i > 0; i--)
tmp -= error_buf[i] * filter_buf[i]; tmp -= error_buf[i] * (unsigned)filter_buf[i];
for (i = 14; i > 0; i--) for (i = 14; i > 0; i--)
error_buf[i] = error_buf[i - 1]; error_buf[i] = error_buf[i - 1];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment