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-05-13 15:39:26 +0300
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-13 16:54:33 +0300
commit74dc728a2c2cc353da20cdc09b8cdfbbe14b7be8 (patch)
tree59e0e72cf34b449ba5fdb9594f8b06f091db94a9 /libavcodec/mlpdec.c
parented93ed5ee320db299dc8c65d59c4f25e2eb0acdc (diff)
avcodec/mlp: Fix multiple runtime error: left shift of negative value -1
Fixes: 1512/clusterfuzz-testcase-minimized-4713846423945216 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mlpdec.c')
-rw-r--r--libavcodec/mlpdec.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/mlpdec.c b/libavcodec/mlpdec.c
index 7cad5d1cad..b471f0d760 100644
--- a/libavcodec/mlpdec.c
+++ b/libavcodec/mlpdec.c
@@ -684,7 +684,7 @@ static int read_filter_params(MLPDecodeContext *m, GetBitContext *gbp,
}
for (i = 0; i < order; i++)
- fcoeff[i] = get_sbits(gbp, coeff_bits) << coeff_shift;
+ fcoeff[i] = get_sbits(gbp, coeff_bits) * (1 << coeff_shift);
if (get_bits1(gbp)) {
int state_bits, state_shift;
@@ -999,8 +999,8 @@ static void generate_2_noise_channels(MLPDecodeContext *m, unsigned int substr)
for (i = 0; i < s->blockpos; i++) {
uint16_t seed_shr7 = seed >> 7;
- m->sample_buffer[i][maxchan+1] = ((int8_t)(seed >> 15)) << s->noise_shift;
- m->sample_buffer[i][maxchan+2] = ((int8_t) seed_shr7) << s->noise_shift;
+ m->sample_buffer[i][maxchan+1] = ((int8_t)(seed >> 15)) * (1 << s->noise_shift);
+ m->sample_buffer[i][maxchan+2] = ((int8_t) seed_shr7) * (1 << s->noise_shift);
seed = (seed << 16) ^ seed_shr7 ^ (seed_shr7 << 5);
}