Commit f4ec9920 authored by Francois Cartegnie's avatar Francois Cartegnie Committed by Jean-Baptiste Kempf

demux: mp4: fix memleak on error

(cherry picked from commit 849b1b27c224a8223a4aa0094db1c6d321733c86)
Signed-off-by: default avatarJean-Baptiste Kempf <jb@videolan.org>
parent 78054320
......@@ -1946,6 +1946,8 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
ck->p_sample_delta_dts = calloc( i_entry, sizeof( uint32_t ) );
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 );
return VLC_ENOMEM;
}
......@@ -2043,6 +2045,8 @@ static int TrackCreateSamplesIndex( demux_t *p_demux,
ck->p_sample_offset_pts = calloc( i_entry, sizeof( int32_t ) );
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 );
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