]> git.sesse.net Git - vlc/commitdiff
Fixes segfault introduced in [18810]
authorRafaël Carré <funman@videolan.org>
Tue, 13 Feb 2007 12:53:50 +0000 (12:53 +0000)
committerRafaël Carré <funman@videolan.org>
Tue, 13 Feb 2007 12:53:50 +0000 (12:53 +0000)
modules/meta_engine/folder.c

index 34c41eec144235c0432945f3c9b48b2792635624..bc40d09e7bff0709917c24d3ab3a1e875d6028bf 100644 (file)
@@ -84,8 +84,9 @@ static int FindMeta( vlc_object_t *p_this )
         *psz_dir = '\0';
     }
 
-    if( !strncmp( psz_dir, "file://", 7 ) )
-        psz_dir += 7;
+    char *psz_path = psz_dir;
+    if( !strncmp( psz_path, "file://", 7 ) )
+        psz_path += 7;
 
     for( i = 0; b_have_art == VLC_FALSE && i < 3; i++ )
     {
@@ -94,19 +95,19 @@ static int FindMeta( vlc_object_t *p_this )
             case 0:
             /* Windows Folder.jpg */
             snprintf( psz_filename, MAX_PATH,
-                      "file://%sFolder.jpg", psz_dir );
+                      "file://%sFolder.jpg", psz_path );
             break;
 
             case 1:
             /* Windows AlbumArtSmall.jpg == small version of Folder.jpg */
             snprintf( psz_filename, MAX_PATH,
-                  "file://%sAlbumArtSmall.jpg", psz_dir );
+                  "file://%sAlbumArtSmall.jpg", psz_path );
             break;
 
             case 2:
             /* KDE (?) .folder.png */
             snprintf( psz_filename, MAX_PATH,
-                  "file://%s.folder.png", psz_dir );
+                  "file://%s.folder.png", psz_path );
             break;
         }