[vlc-devel] commit: XSPF: remove harmful base decoding ( Rémi Denis-Courmont )
git version control
git at videolan.org
Tue Jun 23 21:57:26 CEST 2009
vlc | branch: 1.0-bugfix | Rémi Denis-Courmont <remi at remlab.net> | Tue Jun 23 22:56:36 2009 +0300| [9d3fbd002c9aff5136dfaadf323635828f2b4505] | committer: Rémi Denis-Courmont
XSPF: remove harmful base decoding
(cherry picked from commit 993d4fcc4a511fc1b5d3bc3cafb262dd20e5cf40)
Conflicts:
modules/demux/playlist/xspf.c
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=9d3fbd002c9aff5136dfaadf323635828f2b4505
---
modules/demux/playlist/xspf.c | 23 ++++++++++-------------
1 files changed, 10 insertions(+), 13 deletions(-)
diff --git a/modules/demux/playlist/xspf.c b/modules/demux/playlist/xspf.c
index eee5b85..3bb1715 100644
--- a/modules/demux/playlist/xspf.c
+++ b/modules/demux/playlist/xspf.c
@@ -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;
More information about the vlc-devel
mailing list