aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mlpdsp.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2017-05-13 14:39:26 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2017-05-17 20:35:20 +0200
commit4bc3ae5533f2bec59d3f72fac90709c942e93e44 (patch)
tree288bf1768be7ab548975a7dcf64854fe53e02fb6 /libavcodec/mlpdsp.c
parentd302803c393949a0e9f418e501e22db6e52802c3 (diff)
downloadffmpeg-4bc3ae5533f2bec59d3f72fac90709c942e93e44.tar.gz
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> (cherry picked from commit 74dc728a2c2cc353da20cdc09b8cdfbbe14b7be8) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/mlpdsp.c')
-rw-r--r--libavcodec/mlpdsp.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/mlpdsp.c b/libavcodec/mlpdsp.c
index 3ae8c37708..2fc453c1f0 100644
--- a/libavcodec/mlpdsp.c
+++ b/libavcodec/mlpdsp.c
@@ -113,8 +113,8 @@ int32_t ff_mlp_pack_output(int32_t lossless_check_data,
for (i = 0; i < blockpos; i++) {
for (out_ch = 0; out_ch <= max_matrix_channel; out_ch++) {
int mat_ch = ch_assign[out_ch];
- int32_t sample = sample_buffer[i][mat_ch]
- << output_shift[mat_ch];
+ int32_t sample = sample_buffer[i][mat_ch] *
+ (1 << output_shift[mat_ch]);
lossless_check_data ^= (sample & 0xffffff) << mat_ch;
if (is32)
*data_32++ = sample << 8;