avcodec/adpcm_data: extend ff_adpcm_ima_cunning_index_table
authorMichael Niedermayer <michael@niedermayer.cc>
Wed, 27 May 2020 22:05:16 +0000 (00:05 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Fri, 29 May 2020 17:40:36 +0000 (19:40 +0200)
Fixes: overread by 1
Fixes: 21880/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_ADPCM_IMA_CUNNING_fuzzer-5717917221257216.fuzz

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

index cb9d209..e34e04d 100644 (file)
@@ -178,8 +178,8 @@ const int16_t ff_adpcm_mtaf_stepsize[32][16] = {
        -424, -1273, -2121, -2970, -3819, -4668, -5516, -6365, },
 };
 
-const int8_t ff_adpcm_ima_cunning_index_table[8] = {
-    -1, -1, -1, -1, 1, 2, 3, 4,
+const int8_t ff_adpcm_ima_cunning_index_table[9] = {
+    -1, -1, -1, -1, 1, 2, 3, 4, -1
 };
 
 const int16_t ff_adpcm_ima_cunning_step_table[61] = {
index fa8a03e..d678bfc 100644 (file)
@@ -42,7 +42,7 @@ extern const int16_t ff_adpcm_yamaha_indexscale[];
 extern const int8_t  ff_adpcm_yamaha_difflookup[];
 extern const int16_t ff_adpcm_afc_coeffs[2][16];
 extern const int16_t ff_adpcm_mtaf_stepsize[32][16];
-extern const int8_t  ff_adpcm_ima_cunning_index_table[8];
+extern const int8_t  ff_adpcm_ima_cunning_index_table[9];
 extern const int16_t ff_adpcm_ima_cunning_step_table[61];
 
 #endif /* AVCODEC_ADPCM_DATA_H */