avcodec/mlpdec: Fix: runtime error: left shift of negative value -8
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 18 May 2017 00:07:17 +0000 (02:07 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 18 May 2017 02:08:31 +0000 (04:08 +0200)
Fixes: 1658/clusterfuzz-testcase-minimized-4889937130291200

Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/targets/ffmpeg
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavcodec/mlpdec.c

index eaf1aa7..5426712 100644 (file)
@@ -759,7 +759,7 @@ static int read_matrix_params(MLPDecodeContext *m, unsigned int substr, GetBitCo
             if (get_bits1(gbp))
                 coeff_val = get_sbits(gbp, frac_bits + 2);
 
-            s->matrix_coeff[mat][ch] = coeff_val << (14 - frac_bits);
+            s->matrix_coeff[mat][ch] = coeff_val * (1 << (14 - frac_bits));
         }
 
         if (s->noise_type)