Commit 7c25c3d9 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

mp4: use vlc_alloc() for TREF box

parent 0a366cf2
......@@ -3798,16 +3798,19 @@ static void MP4_FreeBox_tref_generic( MP4_Box_t *p_box )
static int MP4_ReadBox_tref_generic( stream_t *p_stream, MP4_Box_t *p_box )
{
uint32_t count;
MP4_READBOX_ENTER( MP4_Box_data_tref_generic_t, MP4_FreeBox_tref_generic );
p_box->data.p_tref_generic->i_track_ID = NULL;
p_box->data.p_tref_generic->i_entry_count = i_read / sizeof(uint32_t);
if( p_box->data.p_tref_generic->i_entry_count > 0 )
p_box->data.p_tref_generic->i_track_ID = calloc( p_box->data.p_tref_generic->i_entry_count, sizeof(uint32_t) );
count = i_read / sizeof(uint32_t);
p_box->data.p_tref_generic->i_entry_count = count;
p_box->data.p_tref_generic->i_track_ID = vlc_alloc( count,
sizeof(uint32_t) );
if( p_box->data.p_tref_generic->i_track_ID == NULL )
MP4_READBOX_EXIT( 0 );
for( unsigned i = 0; i < p_box->data.p_tref_generic->i_entry_count; i++ )
for( unsigned i = 0; i < count; i++ )
{
MP4_GET4BYTES( p_box->data.p_tref_generic->i_track_ID[i] );
}
......
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