]> git.sesse.net Git - vlc/commitdiff
xspf: correct crash if psz_name is NULL
authorErwan Tulou <erwan10@videolan.org>
Fri, 17 Jul 2009 09:28:16 +0000 (11:28 +0200)
committerErwan Tulou <erwan10@videolan.org>
Fri, 17 Jul 2009 15:20:24 +0000 (17:20 +0200)
modules/misc/playlist/xspf.c

index 76b95bcbb4628d11d9b4c0652e4174ba17b75555..6360931e9a25d87dcf63c18458edd43b64e9d7fc 100644 (file)
@@ -259,10 +259,11 @@ static void xspf_extension_item( playlist_item_t *p_item, FILE *p_file,
     if( p_item->i_children >= 0 )
     {
         int i;
-        char *psz_temp;
-        psz_temp = convert_xml_special_chars( p_item->p_input->psz_name );
+        char *psz_temp = NULL;
+        if( p_item->p_input->psz_name )
+            psz_temp = convert_xml_special_chars( p_item->p_input->psz_name );
         fprintf( p_file, "\t\t<vlc:node title=\"%s\">\n",
-                 *psz_temp ? psz_temp : "" );
+                 psz_temp ? psz_temp : "" );
         free( psz_temp );
 
         for( i = 0; i < p_item->i_children; i++ )