[vlc-commits] demux: avi: fix leak

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


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

demux: avi: fix leak

(cherry picked from commit 8e1f3061937c06e11c6130a1dce8be425c945fd7)

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

 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