[vlc-commits] demux: libavi: fix root size before reads

Francois Cartegnie git at videolan.org
Tue Nov 21 18:21:41 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Nov 21 11:18:19 2017 +0100| [eaf1c02331f65c272c8f8044cd6901faa2f6c403] | committer: Francois Cartegnie

demux: libavi: fix root size before reads

otherwise checks will fail

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=eaf1c02331f65c272c8f8044cd6901faa2f6c403
---

 modules/demux/avi/libavi.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/demux/avi/libavi.c b/modules/demux/avi/libavi.c
index e29d30a060..562e7be100 100644
--- a/modules/demux/avi/libavi.c
+++ b/modules/demux/avi/libavi.c
@@ -1102,7 +1102,7 @@ int AVI_ChunkReadRoot( stream_t *s, avi_chunk_t *p_root )
     vlc_stream_Control( s, STREAM_CAN_SEEK, &b_seekable );
 
     p_list->i_chunk_pos  = 0;
-    p_list->i_chunk_size = stream_Size( s );
+    p_list->i_chunk_size = ((UINT64_MAX - 12) >> 1) << 1;
     p_list->i_chunk_fourcc = AVIFOURCC_LIST;
     p_list->p_father = NULL;
     p_list->p_next  = NULL;
@@ -1142,6 +1142,8 @@ int AVI_ChunkReadRoot( stream_t *s, avi_chunk_t *p_root )
         }
     }
 
+    p_list->i_chunk_size = stream_Size( s );
+
     AVI_ChunkDumpDebug_level( (vlc_object_t*)s, p_root, 0 );
     return VLC_SUCCESS;
 }



More information about the vlc-commits mailing list