Commit 9d3fbd00 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

XSPF: remove harmful base decoding

(cherry picked from commit 993d4fcc)

Conflicts:

	modules/demux/playlist/xspf.c
parent f42e1999
......@@ -210,7 +210,7 @@ static bool parse_playlist_node COMPLEX_INTERFACE
;
else if( !strcmp( psz_name, "xml:base" ) )
{
p_demux->p_sys->psz_base = decode_URI_duplicate( psz_value );
p_demux->p_sys->psz_base = strdup( psz_value );
}
/* unknown attribute */
else
......@@ -546,21 +546,18 @@ static bool parse_track_node COMPLEX_INTERFACE
/* special case: location */
if( !strcmp( p_handler->name, "location" ) )
{
char *psz_location = psz_value;
if( !strncmp( psz_value, "file://", 7 ) )
psz_location = decode_URI( psz_value + 7 );
if( !psz_location )
{
FREE_ATT();
return false;
}
/* FIXME: This is broken. Scheme-relative (//...) locations
* and anchors (#...) are not resolved correctly. Also,
* host-relative (/...) and directory-relative locations
* ("relative path" in vernacular) should be resolved.
* Last, psz_base should default to the XSPF resource
* location if missing (not the current working directory).
* -- Courmisch */
if( p_demux->p_sys->psz_base && !strstr( psz_value, "://" ) )
{
char* psz_tmp;
if( asprintf( &psz_tmp, "%s%s", p_demux->p_sys->psz_base,
psz_location ) == -1 )
psz_value ) == -1 )
{
FREE_ATT();
return NULL;
......@@ -569,7 +566,7 @@ static bool parse_track_node COMPLEX_INTERFACE
free( psz_tmp );
}
else
input_item_SetURI( p_new_input, psz_location );
input_item_SetURI( p_new_input, psz_value );
input_item_CopyOptions( p_input_item, p_new_input );
FREE_ATT();
p_handler = 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