[vlc-commits] demux: libmp4: still read siblings if prev box failed

Francois Cartegnie git at videolan.org
Mon Oct 20 16:42:51 CEST 2014


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Mon Oct 20 16:18:06 2014 +0200| [7604cc2999b9a9169cf4003cb2be2d69ab845faa] | committer: Francois Cartegnie

demux: libmp4: still read siblings if prev box failed

If we discarded an atom, the whole chain was broken.

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

 modules/demux/mp4/libmp4.c |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 0cfdd8f..3c7850c 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -217,7 +217,7 @@ static int MP4_ReadBoxContainerChildrenIndexed( stream_t *p_stream,
                 return 0;
             i_index = GetDWBE(&read[4]);
         }
-        if( ( p_box = MP4_ReadBox( p_stream, p_container ) ) == NULL ) break;
+        if( ( p_box = MP4_ReadBox( p_stream, p_container ) ) == NULL ) continue;
         p_box->i_index = i_index;
 
         /* chain this box with the father and the other at same level */
@@ -3871,7 +3871,9 @@ static MP4_Box_t *MP4_ReadBox( stream_t *p_stream, MP4_Box_t *p_father )
 
     if( !(MP4_Box_Function[i_index].MP4_ReadBox_function)( p_stream, p_box ) )
     {
+        off_t i_end = p_box->i_pos + p_box->i_size;
         MP4_BoxFree( p_stream, p_box );
+        stream_Seek( p_stream, i_end ); /* Skip the failed box */
         return NULL;
     }
 



More information about the vlc-commits mailing list