summaryrefslogtreecommitdiff
path: root/libavcodec/4xm.c
diff options
context:
space:
mode:
authorMans Rullgard <mans@mansr.com>2012-04-28 13:05:18 +0100
committerMans Rullgard <mans@mansr.com>2012-04-29 01:08:37 +0100
commitacb2c79c2102026747468dcafa6780ab1094b3c5 (patch)
tree7b73f3361af99681ce8b5f1dd6a0b34e5c37e68f /libavcodec/4xm.c
parent7fb8b491e5c10b3fbad53ffc89c60d3541114416 (diff)
4xm: fix invalid array indexing
Indexing outside arrays is invalid and breaks with gcc 4.8. Signed-off-by: Mans Rullgard <mans@mansr.com>
Diffstat (limited to 'libavcodec/4xm.c')
-rw-r--r--libavcodec/4xm.c21
1 files changed, 12 insertions, 9 deletions
diff --git a/libavcodec/4xm.c b/libavcodec/4xm.c
index 8cc5592c73..7869264ae1 100644
--- a/libavcodec/4xm.c
+++ b/libavcodec/4xm.c
@@ -240,15 +240,18 @@ static void idct(DCTELEM block[64])
static av_cold void init_vlcs(FourXContext *f)
{
- static VLC_TYPE table[8][32][2];
- int i;
-
- for (i = 0; i < 8; i++) {
- block_type_vlc[0][i].table = table[i];
- block_type_vlc[0][i].table_allocated = 32;
- init_vlc(&block_type_vlc[0][i], BLOCK_TYPE_VLC_BITS, 7,
- &block_type_tab[0][i][0][1], 2, 1,
- &block_type_tab[0][i][0][0], 2, 1, INIT_VLC_USE_NEW_STATIC);
+ static VLC_TYPE table[2][4][32][2];
+ int i, j;
+
+ for (i = 0; i < 2; i++) {
+ for (j = 0; j < 4; j++) {
+ block_type_vlc[i][j].table = table[i][j];
+ block_type_vlc[i][j].table_allocated = 32;
+ init_vlc(&block_type_vlc[i][j], BLOCK_TYPE_VLC_BITS, 7,
+ &block_type_tab[i][j][0][1], 2, 1,
+ &block_type_tab[i][j][0][0], 2, 1,
+ INIT_VLC_USE_NEW_STATIC);
+ }
}
}