Memory allocation error check
authorRémi Denis-Courmont <rem@videolan.org>
Thu, 7 Feb 2008 18:39:43 +0000 (18:39 +0000)
committerRémi Denis-Courmont <rem@videolan.org>
Thu, 7 Feb 2008 18:39:43 +0000 (18:39 +0000)
modules/demux/mp4/mp4.c

index 8bf5723..9ea5ce3 100644 (file)
@@ -1116,6 +1116,10 @@ static int TrackCreateChunksIndex( demux_t *p_demux,
     }
     p_demux_track->chunk = calloc( p_demux_track->i_chunk_count,
                                    sizeof( mp4_chunk_t ) );
+    if( p_demux_track->chunk == NULL )
+    {
+        return VLC_ENOMEM;
+    }
 
     /* first we read chunk offset */
     for( i_chunk = 0; i_chunk < p_demux_track->i_chunk_count; i_chunk++ )