From: Rafaël Carré Date: Sun, 21 Oct 2007 12:56:41 +0000 (+0000) Subject: xspf demuxer: correctly checks "application" attribute of tag, fix #1342 X-Git-Tag: 0.9.0-test0~4884 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=21aa24f666b07c375fdf9cd15d3783c55a329374;p=vlc xspf demuxer: correctly checks "application" attribute of tag, fix #1342 --- diff --git a/modules/demux/playlist/xspf.c b/modules/demux/playlist/xspf.c index 50c88bfb3d..dcd5723371 100644 --- a/modules/demux/playlist/xspf.c +++ b/modules/demux/playlist/xspf.c @@ -652,6 +652,7 @@ static vlc_bool_t parse_extension_node COMPLEX_INTERFACE char *psz_name = NULL; char *psz_value = NULL; char *psz_title = NULL; + char *psz_application = NULL; int i_node; xml_elem_hnd_t *p_handler = NULL; @@ -677,9 +678,14 @@ static vlc_bool_t parse_extension_node COMPLEX_INTERFACE { psz_title = unescape_URI_duplicate( psz_value ); } + /* extension attribute: application */ + if( !strcmp( psz_name, "application" ) ) + { + psz_application = strdup( psz_value ); + } /* unknown attribute */ else - msg_Warn( p_demux, "invalid attribute:\"%s\"", psz_name); + msg_Warn( p_demux, "invalid <%s> attribute:\"%s\"", psz_element, psz_name ); FREE_ATT(); } @@ -690,7 +696,23 @@ static vlc_bool_t parse_extension_node COMPLEX_INTERFACE msg_Warn( p_demux, " requires \"title\" attribute" ); return VLC_FALSE; } - if( psz_title ) free( psz_title ); + free( psz_title ); + + if( !strcmp( psz_element, "extension" ) ) + { + if( !psz_application ) + { + msg_Warn( p_demux, " requires \"application\" attribute" ); + return VLC_FALSE; + } + else if( strcmp( psz_application, "http://www.videolan.org/vlc/playlist/0" ) ) + { + msg_Dbg( p_demux, "Skipping \"%s\" extension tag", psz_application ); + free( psz_application ); + return VLC_FALSE; + } + } + free( psz_application ); /* parse the child elements */ while( xml_ReaderRead( p_xml_reader ) == 1 )