[vlc-commits] demux: libmp4: don't return empty fake root if peek fails

Francois Cartegnie git at videolan.org
Tue Jan 17 20:27:35 CET 2017


vlc | branch: master | Francois Cartegnie <fcvlcdev at free.fr> | Sun Mar 27 14:44:03 2016 +0200| [180979bbf205ec3d2243b3608e35bd19ebc33f6e] | committer: Francois Cartegnie

demux: libmp4: don't return empty fake root if peek fails

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

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

diff --git a/modules/demux/mp4/libmp4.c b/modules/demux/mp4/libmp4.c
index 7717423..133f77f 100644
--- a/modules/demux/mp4/libmp4.c
+++ b/modules/demux/mp4/libmp4.c
@@ -4638,7 +4638,11 @@ MP4_Box_t *MP4_BoxGetNextChunk( stream_t *s )
         return NULL;
 
     /* We might get a ftyp box or a SmooBox */
-    MP4_PeekBoxHeader( s, p_tmp_box );
+    if( MP4_PeekBoxHeader( s, p_tmp_box ) == 0 )
+    {
+        free( p_tmp_box );
+        return NULL;
+    }
 
     if( p_tmp_box->i_type == ATOM_ftyp )
     {



More information about the vlc-commits mailing list