[vlc-commits] demux: avi: continue parsing list on empty box
Francois Cartegnie
git at videolan.org
Tue Jul 9 14:42:20 CEST 2019
vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Tue Jul 9 14:38:44 2019 +0200| [55febc1e137d4f7ae0683d287594de5ebe93d468] | 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
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=55febc1e137d4f7ae0683d287594de5ebe93d468
---
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 5b2ad45ef1..ba35a3f88a 100644
--- a/modules/demux/avi/libavi.c
+++ b/modules/demux/avi/libavi.c
@@ -207,12 +207,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 ) )
@@ -221,7 +226,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