diff --git a/modules/demux/avi/avi.c b/modules/demux/avi/avi.c
index 67026e4831a624042fb4da3cc7d084c57656870a..88a8f081386572e89740cf5faa542839ad450580 100644
--- a/modules/demux/avi/avi.c
+++ b/modules/demux/avi/avi.c
@@ -2118,7 +2118,7 @@ static void AVI_IndexLoad_indx( demux_t *p_demux )
         }
         else if( p_indx->i_indextype == AVI_INDEX_OF_INDEXES )
         {
-            avi_chunk_indx_t    ck_sub;
+            avi_chunk_t    ck_sub;
             for( i = 0; i < p_indx->i_entriesinuse; i++ )
             {
                 if( stream_Seek( p_demux->s, p_indx->idx.super[i].i_offset )||
@@ -2126,7 +2126,7 @@ static void AVI_IndexLoad_indx( demux_t *p_demux )
                 {
                     break;
                 }
-                __Parse_indx( p_demux, i_stream, &ck_sub );
+                __Parse_indx( p_demux, i_stream, &ck_sub.indx );
             }
         }
         else
diff --git a/modules/demux/avi/libavi.h b/modules/demux/avi/libavi.h
index 8db39b386686e2b0978774a05a12586358d31d0c..28d5d675fcb806f8565d51a8166802439b2520a4 100644
--- a/modules/demux/avi/libavi.h
+++ b/modules/demux/avi/libavi.h
@@ -224,10 +224,7 @@ int     AVI_ChunkReadRoot( stream_t *, avi_chunk_t *p_root );
 void    AVI_ChunkFreeRoot( stream_t *, avi_chunk_t  *p_chk );
 
 #define AVI_ChunkRead( s, p_chk, p_father ) \
-    _AVI_ChunkRead( s, \
-                    (avi_chunk_t*)p_chk, \
-                    (avi_chunk_t*)p_father )
-
+    _AVI_ChunkRead( s, p_chk, (avi_chunk_t*)p_father )
 #define AVI_ChunkCount( p_chk, i_fourcc ) \
     _AVI_ChunkCount( (avi_chunk_t*)p_chk, i_fourcc )
 #define AVI_ChunkFind( p_chk, i_fourcc, i_number ) \