From: Laurent Aimar Date: Thu, 21 Aug 2008 16:22:41 +0000 (+0200) Subject: Check a few mp4 mallocs. X-Git-Tag: 0.9.0~140 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=0bf165646d0dd39ad1bc698cdde0bbff1711e24d;p=vlc Check a few mp4 mallocs. --- diff --git a/modules/demux/mp4/mp4.c b/modules/demux/mp4/mp4.c index ffd20f6ebc..d84f4f0302 100644 --- a/modules/demux/mp4/mp4.c +++ b/modules/demux/mp4/mp4.c @@ -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;