]> git.sesse.net Git - ffmpeg/commitdiff
avcodec/mpc7, mpc7data: Make overlong arrays smaller
authorAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 15 Sep 2020 01:45:22 +0000 (03:45 +0200)
committerAndreas Rheinhardt <andreas.rheinhardt@gmail.com>
Tue, 15 Sep 2020 20:13:24 +0000 (22:13 +0200)
For the VLC table arrays in mpc7_decode_init() this fixes
a regression introduced in 1e40dc920a838e35f1483b20bfcd417437e68741.

Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@gmail.com>
libavcodec/mpc7.c
libavcodec/mpc7data.h

index 8518bc2f8acf99934cd0c8351eb764c7afebb629..3c9ef6a60082164577e0205d52eae257777b9a06 100644 (file)
@@ -97,10 +97,10 @@ static av_cold int mpc7_decode_init(AVCodecContext * avctx)
                     &mpc7_scfi[0], 2, 1, 1 << MPC7_SCFI_BITS);
     INIT_VLC_STATIC(&dscf_vlc, MPC7_DSCF_BITS, MPC7_DSCF_SIZE,
                     &mpc7_dscf[1], 2, 1,
-                    &mpc7_dscf[0], 2, 1, 1 << MPC7_DSCF_SIZE);
+                    &mpc7_dscf[0], 2, 1, 1 << MPC7_DSCF_BITS);
     INIT_VLC_STATIC(&hdr_vlc, MPC7_HDR_BITS, MPC7_HDR_SIZE,
                     &mpc7_hdr[1], 2, 1,
-                    &mpc7_hdr[0], 2, 1, 1 << MPC7_HDR_SIZE);
+                    &mpc7_hdr[0], 2, 1, 1 << MPC7_HDR_BITS);
     for(i = 0; i < MPC7_QUANT_VLC_TABLES; i++){
         for(j = 0; j < 2; j++){
             quant_vlc[i][j].table = &quant_tables[quant_offsets[i*2 + j]];
index 5609e8fbf3015e67177eebcfea955af1cd257a61..90ab75fe6545bd3a619a8fb838be2c6b5396d107 100644 (file)
@@ -51,7 +51,7 @@ static const uint8_t mpc7_hdr[MPC7_HDR_SIZE * 2] = {
 };
 
 #define MPC7_QUANT_VLC_TABLES 7
-static const uint8_t mpc7_quant_vlc_sizes[MPC7_QUANT_VLC_TABLES * 2] = {
+static const uint8_t mpc7_quant_vlc_sizes[MPC7_QUANT_VLC_TABLES] = {
     27, 25, 7, 9, 15, 31, 63
 };