]> git.sesse.net Git - vlc/commitdiff
fix [22632]: check psz_arturl before using it
authorRafaël Carré <funman@videolan.org>
Tue, 16 Oct 2007 12:44:47 +0000 (12:44 +0000)
committerRafaël Carré <funman@videolan.org>
Tue, 16 Oct 2007 12:44:47 +0000 (12:44 +0000)
src/input/meta.c
src/playlist/engine.c

index 92ac141fcabbd1f51ee109baed02d2174e3803a4..544984f2ba89e886fe2ff13bff3b478fb54f63cb 100644 (file)
@@ -165,7 +165,7 @@ int input_ArtFind( playlist_t *p_playlist, input_item_t *p_item )
     input_FindArtInCache( p_playlist, p_item );
 
     char *psz_arturl = input_item_GetArtURL( p_item );
-    if( !strncmp( psz_arturl, "file://", strlen( "file://" ) ) )
+    if( psz_arturl && !strncmp( psz_arturl, "file://", strlen( "file://" ) ) )
     {
         free( psz_arturl );
         return 0; /* Art is in cache, no need to go further */
index 8d852c9285f0e6cefc92b93a3201061c927517ec..65eaa2b618dd7c05d49f3e9d6b4a4be9cc43a283 100644 (file)
@@ -534,7 +534,8 @@ void playlist_PreparseLoop( playlist_preparse_t *p_obj )
             }
             /* We already have all needed meta, but we need art right now */
             else if( p_playlist->p_fetcher->i_art_policy == ALBUM_ART_ALL &&
-                     strncmp( psz_arturl, "file://", strlen("file://") ) )
+                     !psz_arturl ? 1 :
+                        strncmp( psz_arturl, "file://", strlen("file://") ) )
             {
                 preparse_item_t p;
                 PL_DEBUG("meta ok for %s, need to fetch art", psz_name );