mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
avcodec/dss_sp: Fix multiple left shift of negative value -466
Fixes: 1339/clusterfuzz-testcase-minimized-4614671485108224
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 38152d9368
)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
parent
2197423ec9
commit
a6e7636dac
@ -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) << 15) + (b) * (c)) + 0x4000) >> 15)
|
#define DSS_SP_FORMULA(a, b, c) (((((a) * (1 << 15)) + (b) * (c)) + 0x4000) >> 15)
|
||||||
|
|
||||||
typedef struct DssSpSubframe {
|
typedef struct DssSpSubframe {
|
||||||
int16_t gain;
|
int16_t gain;
|
||||||
@ -499,7 +499,7 @@ static void dss_sp_scale_vector(int32_t *vec, int bits, int size)
|
|||||||
vec[i] = vec[i] >> -bits;
|
vec[i] = vec[i] >> -bits;
|
||||||
else
|
else
|
||||||
for (i = 0; i < size; i++)
|
for (i = 0; i < size; i++)
|
||||||
vec[i] = vec[i] << bits;
|
vec[i] = vec[i] * (1 << bits);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void dss_sp_update_buf(int32_t *hist, int32_t *vector)
|
static void dss_sp_update_buf(int32_t *hist, int32_t *vector)
|
||||||
|
Loading…
Reference in New Issue
Block a user