Commit ba00f4c0 authored by Pierre Ynard's avatar Pierre Ynard

XML: throw an error if HTML subtitles have no root node

This shouldn't happen unless the codec is buggy
parent 39a6fe50
...@@ -2181,11 +2181,20 @@ static int RenderHtml( filter_t *p_filter, subpicture_region_t *p_region_out, ...@@ -2181,11 +2181,20 @@ static int RenderHtml( filter_t *p_filter, subpicture_region_t *p_region_out,
/* Only text and karaoke tags are supported */ /* Only text and karaoke tags are supported */
msg_Dbg( p_filter, "Unsupported top-level tag <%s> ignored.", msg_Dbg( p_filter, "Unsupported top-level tag <%s> ignored.",
node ); node );
p_filter->p_sys->p_xml = xml_ReaderReset( p_xml_reader, NULL );
p_xml_reader = NULL;
rv = VLC_EGENERIC; rv = VLC_EGENERIC;
} }
} }
else
{
msg_Err( p_filter, "Malformed HTML subtitle" );
rv = VLC_EGENERIC;
}
if( rv != VLC_SUCCESS )
{
p_filter->p_sys->p_xml = xml_ReaderReset( p_xml_reader, NULL );
p_xml_reader = NULL;
}
} }
if( p_xml_reader ) if( p_xml_reader )
......
...@@ -833,10 +833,21 @@ static int RenderHtml( filter_t *p_filter, subpicture_region_t *p_region_out, ...@@ -833,10 +833,21 @@ static int RenderHtml( filter_t *p_filter, subpicture_region_t *p_region_out,
else else
{ {
/* Only text and karaoke tags are supported */ /* Only text and karaoke tags are supported */
xml_ReaderDelete( p_xml_reader ); msg_Dbg( p_filter, "Unsupported top-level tag "
p_xml_reader = NULL; "<%s> ignored.", name );
rv = VLC_EGENERIC;
}
}
else
{
msg_Err( p_filter, "Malformed HTML subtitle" );
rv = VLC_EGENERIC; rv = VLC_EGENERIC;
} }
if( rv != VLC_SUCCESS )
{
xml_ReaderDelete( p_xml_reader );
p_xml_reader = NULL;
} }
} }
......
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