[vlc-commits] demux: avi: workaround broken RIFF header values

Francois Cartegnie git at videolan.org
Thu Jan 4 13:28:28 CET 2018


vlc/vlc-3.0 | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Thu Jan  4 13:14:34 2018 +0100| [68714f231d7bdd41e1939a23ab665364ef04f6c1] | committer: Francois Cartegnie

demux: avi: workaround broken RIFF header values

(cherry picked from commit 50c43317275c7551935dbae934bb2d25d6d67138)

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

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

diff --git a/modules/demux/avi/libavi.c b/modules/demux/avi/libavi.c
index fca5b32a6e..6b04dfb93e 100644
--- a/modules/demux/avi/libavi.c
+++ b/modules/demux/avi/libavi.c
@@ -89,7 +89,12 @@ static int AVI_ChunkReadCommon( stream_t *s, avi_chunk_t *p_chk,
     {
         msg_Warn( s, "chunk %4.4s does not fit into parent %ld",
                      (char*)&p_chk->common.i_chunk_fourcc, AVI_ChunkEnd( p_father ) );
-        return VLC_EGENERIC;
+
+        /* How hard is to produce files with the correct declared size ? */
+        if( p_father->common.i_chunk_fourcc != AVIFOURCC_RIFF ||
+            p_father->common.p_father == NULL ||
+            p_father->common.p_father->common.p_father != NULL ) /* Root > RIFF only */
+            return VLC_EGENERIC;
     }
 
 #ifdef AVI_DEBUG



More information about the vlc-commits mailing list