[vlc-commits] demux: avi: fix leak

Francois Cartegnie git at videolan.org
Fri Dec 15 16:42:42 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Fri Dec 15 10:36:41 2017 +0100| [8e1f3061937c06e11c6130a1dce8be425c945fd7] | committer: Francois Cartegnie

demux: avi: fix leak

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

 modules/demux/avi/libavi.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/demux/avi/libavi.c b/modules/demux/avi/libavi.c
index 057fb84fa2..fca5b32a6e 100644
--- a/modules/demux/avi/libavi.c
+++ b/modules/demux/avi/libavi.c
@@ -1131,17 +1131,18 @@ int AVI_ChunkReadRoot( stream_t *s, avi_chunk_t *p_root )
             free( p_chk );
             break;
         }
-        else if( vlc_stream_Tell( s ) >=
+
+        *pp_append = p_chk;
+        while( *pp_append )
+            pp_append = &((*pp_append)->common.p_next);
+
+        if( vlc_stream_Tell( s ) >=
                  p_chk->common.p_father->common.i_chunk_pos +
                  __EVEN( p_chk->common.p_father->common.i_chunk_size ) )
         {
             break;
         }
 
-        *pp_append = p_chk;
-        while( *pp_append )
-            pp_append = &((*pp_append)->common.p_next);
-
         /* If we can't seek then stop when we 've found first RIFF-AVI */
         if( p_chk->common.i_chunk_fourcc == AVIFOURCC_RIFF &&
             p_chk->list.i_type == AVIFOURCC_AVI && !b_seekable )



More information about the vlc-commits mailing list