[vlc-devel] commit: xspf: correct crash if psz_name is NULL (Erwan Tulou )

git version control git at videolan.org
Fri Jul 17 17:24:48 CEST 2009


vlc | branch: 1.0-bugfix | Erwan Tulou <erwan10 at videolan.org> | Fri Jul 17 11:28:16 2009 +0200| [005f844fd4fecfc9ab10c1cb005dfd1b8aca5780] | committer: Erwan Tulou 

xspf: correct crash if psz_name is NULL
(cherry picked from commit 97c42d976041512ba3f196e91a40ab04aa1d16ec)

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=005f844fd4fecfc9ab10c1cb005dfd1b8aca5780
---

 modules/misc/playlist/xspf.c |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/modules/misc/playlist/xspf.c b/modules/misc/playlist/xspf.c
index 6765adb..923d57b 100644
--- a/modules/misc/playlist/xspf.c
+++ b/modules/misc/playlist/xspf.c
@@ -263,10 +263,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++ )




More information about the vlc-devel mailing list