]> git.sesse.net Git - vlc/commitdiff
demux: libmp4: fix fwd null dereference (cid #1260237)
authorFrancois Cartegnie <fcvlcdev@free.fr>
Mon, 22 Dec 2014 17:50:13 +0000 (18:50 +0100)
committerFrancois Cartegnie <fcvlcdev@free.fr>
Mon, 22 Dec 2014 18:21:47 +0000 (19:21 +0100)
modules/demux/mp4/libmp4.c

index 33bf66e37c8b871f49e22781ad98562693cb8f2b..d962b7a109aa8e03e6e74f94c820fbeb881b1dc4 100644 (file)
@@ -297,10 +297,12 @@ static void MP4_BoxOffsetUp( MP4_Box_t *p_box, uint64_t i_offset )
 static int MP4_ReadBoxContainerRawInBox( stream_t *p_stream, MP4_Box_t *p_container,
                                          uint8_t *p_buffer, uint64_t i_size, uint64_t i_offset )
 {
+    if(!p_container)
+        return 0;
     stream_t *p_substream = stream_MemoryNew( p_stream, p_buffer, i_size, true );
     if( !p_substream )
         return 0;
-    MP4_Box_t *p_last = (p_container) ? p_container->p_last : NULL;
+    MP4_Box_t *p_last = p_container->p_last;
     MP4_ReadBoxContainerRaw( p_substream, p_container );
     stream_Delete( p_substream );
     /* do pos fixup */