Commit 52ae2e38 authored by Francois Cartegnie's avatar Francois Cartegnie

demux: ttml: fix endless loops on broken charset

parent 59b68252
...@@ -209,6 +209,8 @@ static int ReadTTML( demux_t* p_demux ) ...@@ -209,6 +209,8 @@ static int ReadTTML( demux_t* p_demux )
do do
{ {
i_type = xml_ReaderNextNode( p_sys->p_reader, &psz_name ); i_type = xml_ReaderNextNode( p_sys->p_reader, &psz_name );
if( i_type <= XML_READER_NONE )
break;
if ( i_type == XML_READER_STARTELEM && ( !strcasecmp( psz_name, "head" ) || !strcasecmp( psz_name, "tt:head" ) ) ) if ( i_type == XML_READER_STARTELEM && ( !strcasecmp( psz_name, "head" ) || !strcasecmp( psz_name, "tt:head" ) ) )
{ {
...@@ -271,7 +273,9 @@ static int ReadTTML( demux_t* p_demux ) ...@@ -271,7 +273,9 @@ static int ReadTTML( demux_t* p_demux )
i_type = xml_ReaderNextNode( p_sys->p_reader, &psz_name ); i_type = xml_ReaderNextNode( p_sys->p_reader, &psz_name );
while ( i_type != XML_READER_ENDELEM || ( strcmp( psz_name, "p" ) && strcmp( psz_name, "tt:p" ) ) ) while ( i_type > XML_READER_NONE && ( i_type != XML_READER_ENDELEM
|| ( strcmp( psz_name, "p" ) && strcmp( psz_name, "tt:p" ) ) )
)
{ {
if ( i_type == XML_READER_TEXT && psz_name != NULL ) if ( i_type == XML_READER_TEXT && psz_name != 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