]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/mimic.c
avcodec/takdec: Fix runtime error: left shift of negative value -42
[ffmpeg] / libavcodec / mimic.c
index 0cc30ab0ede449ec8cea66cc86d939721b9c16e5..607dffa4a5a2009ffe547e795c53f8696ffba50b 100644 (file)
@@ -260,9 +260,9 @@ static int vlc_decode_block(MimicContext *ctx, int num_coeffs, int qscale)
         /* FFmpeg's IDCT behaves somewhat different from the original code, so
          * a factor of 4 was added to the input */
 
-        coeff = vlcdec_lookup[num_bits][value];
+        coeff = ((int8_t*)vlcdec_lookup[num_bits])[value];
         if (pos < 3)
-            coeff <<= 4;
+            coeff *= 16;
         else /* TODO Use >> 10 instead of / 1001 */
             coeff = (coeff * qscale) / 1001;