[vlc-commits] demux: avi: continue parsing list on empty box

Francois Cartegnie git at videolan.org
Mon Jul 15 17:04:22 CEST 2019


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jul  9 14:38:44 2019 +0200| [0f44d147812899446376b8521556cfe629df13ef] | committer: Francois Cartegnie

demux: avi: continue parsing list on empty box

some broken files have empty strf between 2 strh
refs V_CODECS/qnap/2010-10-15 14-02-00~14-04-00.avi

(cherry picked from commit 55febc1e137d4f7ae0683d287594de5ebe93d468)

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

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

diff --git a/modules/demux/avi/libavi.c b/modules/demux/avi/libavi.c
index a622b9a3cd..49ca6b0aca 100644
--- a/modules/demux/avi/libavi.c
+++ b/modules/demux/avi/libavi.c
@@ -208,12 +208,17 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t *p_container )
         {
             AVI_ChunkClean( s, p_chk );
             free( p_chk );
-            break;
+            p_chk = NULL;
+            if( i_ret != AVI_ZEROSIZED_CHUNK )
+                break;
         }
 
-        *pp_append = p_chk;
-        while( *pp_append )
-            pp_append = &((*pp_append)->common.p_next);
+        if( p_chk )
+        {
+            *pp_append = p_chk;
+            while( *pp_append )
+                pp_append = &((*pp_append)->common.p_next);
+        }
 
         if( p_container->common.i_chunk_size > 0 &&
             vlc_stream_Tell( s ) >= AVI_ChunkEnd( p_container ) )
@@ -222,7 +227,8 @@ static int AVI_ChunkRead_list( stream_t *s, avi_chunk_t *p_container )
         }
 
         /* If we can't seek then stop when we 've found LIST-movi */
-        if( p_chk->common.i_chunk_fourcc == AVIFOURCC_LIST &&
+        if( p_chk &&
+            p_chk->common.i_chunk_fourcc == AVIFOURCC_LIST &&
             p_chk->list.i_type == AVIFOURCC_movi &&
             ( !b_seekable || p_chk->common.i_chunk_size == 0 ) )
         {



More information about the vlc-commits mailing list