]> git.sesse.net Git - vlc/commitdiff
Check a few mp4 mallocs.
authorLaurent Aimar <fenrir@videolan.org>
Thu, 21 Aug 2008 16:22:41 +0000 (18:22 +0200)
committerLaurent Aimar <fenrir@videolan.org>
Thu, 21 Aug 2008 17:08:54 +0000 (19:08 +0200)
modules/demux/mp4/mp4.c

index ffd20f6ebc9e3e01a8e08951005a48e1c8563aa7..d84f4f03024bf820fcfac77a1af990014e374d87 100644 (file)
@@ -1270,6 +1270,9 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
         ck->p_sample_count_dts = calloc( i_entry, sizeof( uint32_t ) );
         ck->p_sample_delta_dts = calloc( i_entry, sizeof( uint32_t ) );
 
+        if( !ck->p_sample_count_dts || !ck->p_sample_delta_dts )
+            return VLC_ENOMEM;
+
         /* now copy */
         i_sample_count = ck->i_sample_count;
         for( i = 0; i < i_entry; i++ )
@@ -1333,6 +1336,8 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
             /* allocate them */
             ck->p_sample_count_pts = calloc( i_entry, sizeof( uint32_t ) );
             ck->p_sample_offset_pts = calloc( i_entry, sizeof( int32_t ) );
+            if( !ck->p_sample_count_pts || !ck->p_sample_offset_pts )
+                return VLC_ENOMEM;
 
             /* now copy */
             i_sample_count = ck->i_sample_count;