Browse Source

ttml: fix null deref on empty namespace uri

refs #29053
resf #29055
regression by 44879313ba

ttml: fix null deref on empty uri
pull/177/head
François Cartegnie 1 year ago
committed by Felix Paul Kühne
parent
commit
d16c61873f
  1. 2
      modules/codec/ttml/ttml.c
  2. 2
      modules/demux/ttml.c

2
modules/codec/ttml/ttml.c

@ -129,7 +129,7 @@ const char * tt_namespaces_GetPrefix( const tt_namespaces_t *nss,
void tt_namespaces_Register( tt_namespaces_t *nss, const char *psz_prefix,
const char *psz_uri )
{
if( tt_namespaces_GetPrefix( nss, psz_uri ) )
if( !psz_uri || tt_namespaces_GetPrefix( nss, psz_uri ) )
return;
struct tt_namespace_s *ns = malloc(sizeof(*ns));
if( ns )

2
modules/demux/ttml.c

@ -174,7 +174,7 @@ static int ReadTTML( demux_t* p_demux )
break;
case XML_READER_STARTELEM:
if( strcmp( psz_node_namespace, TT_NS ) ||
if( (psz_node_namespace && strcmp( psz_node_namespace, TT_NS )) ||
strcmp( tt_LocalName( psz_node_name ), "tt" ) ||
p_sys->p_rootnode != NULL )
return VLC_EGENERIC;

Loading…
Cancel
Save