Commit 77b82423 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: libmp4: enforce handler check on meta atom

parent 1e1dbbe3
......@@ -3100,33 +3100,27 @@ static int MP4_ReadBox_meta( stream_t *p_stream, MP4_Box_t *p_box )
if( i_actually_read < 8 )
return 0;
if ( !p_box->p_father )
return 0;
switch( p_box->p_father->i_type )
if ( p_box->p_father && p_box->p_father->i_type == ATOM_udta ) /* itunes udta/meta */
{
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 )
if( i_actually_read < 4 || memcmp( meta_data, "\0\0\0", 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;
if ( !MP4_ReadBoxContainerChildren( p_stream, p_box, ATOM_hdlr ) )
return 0;
/* Mandatory */
if ( VLC_FOURCC( meta_data[4], meta_data[5], meta_data[6], meta_data[7] ) != ATOM_hdlr )
return 0;
/* Mandatory */
const MP4_Box_t *p_hdlr = MP4_BoxGet( p_box, "hdlr" );
if ( !p_hdlr || !BOXDATA(p_hdlr) ||
( BOXDATA(p_hdlr)->i_handler_type != VLC_FOURCC('m', 'd', 't', 'a') &&
BOXDATA(p_hdlr)->i_handler_type != VLC_FOURCC('m', 'd', 'i', 'r') ) ||
BOXDATA(p_hdlr)->i_version != 0 )
return 0;
//ft
}
return 1;
/* then it behaves like a container */
return MP4_ReadBoxContainerRaw( p_stream, p_box );
}
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