Commit 34d9105e authored by François Cartegnie's avatar François Cartegnie 🤞

demux: mp4: meta != udta/meta

stop trying to read random atoms
parent 34f2fc37
......@@ -2854,13 +2854,33 @@ static int MP4_ReadBox_meta( stream_t *p_stream, MP4_Box_t *p_box )
if( i_actually_read < 8 )
return 0;
/* meta content starts with a 4 byte version/flags value (should be 0) */
i_actually_read = stream_Read( p_stream, meta_data, 4 );
if( i_actually_read < 4 )
if ( !p_box->p_father )
return 0;
/* then it behaves like a container */
return MP4_ReadBoxContainerRaw( p_stream, p_box );
switch( p_box->p_father->i_type )
{
case ATOM_udta: /* itunes udta/meta */
/* meta content starts with a 4 byte version/flags value (should be 0) */
i_actually_read = stream_Read( p_stream, meta_data, 4 );
if( i_actually_read < 4 )
return 0;
/* then it behaves like a container */
return MP4_ReadBoxContainerRaw( p_stream, p_box );
default: /* regular meta atom */
i_actually_read = stream_Read( p_stream, meta_data, 8 );
if( i_actually_read < 8 )
return 0;
/* Mandatory */
if ( VLC_FOURCC( meta_data[4], meta_data[5], meta_data[6], meta_data[7] ) != ATOM_hdlr )
return 0;
//ft
}
return 1;
}
static int MP4_ReadBox_iods( stream_t *p_stream, MP4_Box_t *p_box )
......
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