Browse Source

demux/mp4: adjust to changes introduced by 8f9b76e

ExtractIntlStrings is only applicable for a limited range of boxes,
though with the recent changes following its introduction it might be
invoked for entities it is currently not protected from misdiagnosing.

These changes make sure that we only interpret a box inside the
function if:

 - the atom is known as a metadata box
 - the box has been parsed
 - the box has a father, and it is ATOM_udta

The check so that we do not parse boxes that contain a "data"-box has
been removed given that this check is more suitable at where the call
to the function is made.

Signed-off-by: Francois Cartegnie <fcvlcdev@free.fr>
pull/50/merge
Filip Roséen 10 years ago
committed by Francois Cartegnie
parent
commit
c19f472ff0
  1. 13
      modules/demux/mp4/meta.c

13
modules/demux/mp4/meta.c

@ -241,10 +241,7 @@ static bool SetMeta( vlc_meta_t* p_meta, int i_type, char const* name, MP4_Box_t
static int ExtractIntlStrings( vlc_meta_t *p_meta, MP4_Box_t *p_box )
{
if( *(uint8_t*)&p_box->i_type != 0xa9 || MP4_BoxGet( p_box, "data" ) )
return false;
if( p_box->data.p_binary->p_blob == NULL )
if( MP4_BoxGet( p_box, "data" ) )
return false;
vlc_meta_type_t const* meta_type;
@ -253,6 +250,14 @@ static int ExtractIntlStrings( vlc_meta_t *p_meta, MP4_Box_t *p_box )
if( AtomXA9ToMeta( p_box->i_type, &meta_type, &meta_key ) == false )
return false;
if( p_box->p_father == NULL ||
p_box->p_father->i_type != ATOM_udta ||
p_box->data.p_binary == NULL ||
p_box->data.p_binary->p_blob == NULL )
{
return false;
}
vlc_meta_t* p_meta_intl = vlc_meta_New();
if( unlikely( !p_meta_intl ) )

Loading…
Cancel
Save