Commit 849b1b27 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: mp4: fix memleak on error

parent d53b7dc4
...@@ -2102,6 +2102,8 @@ static int TrackCreateSamplesIndex( demux_t *p_demux, ...@@ -2102,6 +2102,8 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
ck->p_sample_delta_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 ) if( !ck->p_sample_count_dts || !ck->p_sample_delta_dts )
{ {
free( ck->p_sample_count_dts );
free( ck->p_sample_delta_dts );
msg_Err( p_demux, "can't allocate memory for i_entry=%"PRIu32, i_entry ); msg_Err( p_demux, "can't allocate memory for i_entry=%"PRIu32, i_entry );
return VLC_ENOMEM; return VLC_ENOMEM;
} }
...@@ -2199,6 +2201,8 @@ static int TrackCreateSamplesIndex( demux_t *p_demux, ...@@ -2199,6 +2201,8 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
ck->p_sample_offset_pts = calloc( i_entry, sizeof( int32_t ) ); ck->p_sample_offset_pts = calloc( i_entry, sizeof( int32_t ) );
if( !ck->p_sample_count_pts || !ck->p_sample_offset_pts ) if( !ck->p_sample_count_pts || !ck->p_sample_offset_pts )
{ {
free( ck->p_sample_count_pts );
free( ck->p_sample_offset_pts );
msg_Err( p_demux, "can't allocate memory for i_entry=%"PRIu32, i_entry ); msg_Err( p_demux, "can't allocate memory for i_entry=%"PRIu32, i_entry );
return VLC_ENOMEM; return VLC_ENOMEM;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment