avcodec/mimic: Fix runtime error: index 96 out of bounds for type 'const int8_t ...
authorMichael Niedermayer <michael@niedermayer.cc>
Thu, 11 May 2017 13:07:28 +0000 (15:07 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Thu, 11 May 2017 13:51:08 +0000 (15:51 +0200)
Fixes: 1468/clusterfuzz-testcase-minimized-5235964056174592

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

index 61ce1ce..607dffa 100644 (file)
@@ -260,7 +260,7 @@ 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 *= 16;
         else /* TODO Use >> 10 instead of / 1001 */