]> git.sesse.net Git - vlc/blobdiff - modules/gui/wxwindows/playlist.cpp
* modules/gui/wxwindows/playlist.cpp: fixed uninitialized memory access.
[vlc] / modules / gui / wxwindows / playlist.cpp
index bf91c8c9e19c0d05ddd79eda363e61b84418a87b..d4929ed27fbf153f955d083064f82683748aa6ed 100644 (file)
@@ -342,22 +342,13 @@ Playlist::Playlist( intf_thread_t *_p_intf, wxWindow *p_parent ):
                                wxTR_MULTIPLE | wxTR_EXTENDED );
 
     /* Create image list */
-
-    wxImageList *p_images = new wxImageList( 16 , 16, TRUE);
-
-    wxIcon icons[10];
-    icons[ ITEM_TYPE_UNKNOWN ] = wxIcon( type_unknown_xpm );
-    icons[ ITEM_TYPE_DISC ] = wxIcon( type_disc_xpm );
-    icons[ ITEM_TYPE_DIRECTORY ] = wxIcon( type_directory_xpm );
-    icons[ ITEM_TYPE_PLAYLIST ] = wxIcon( type_playlist_xpm );
-    icons[ ITEM_TYPE_NET ] = wxIcon( type_net_xpm );
-    icons[ ITEM_TYPE_CARD ] = wxIcon( type_card_xpm );
-
-    for( unsigned int i = 0; i< WXSIZEOF( icons ) ; i++ )
-    {
-         p_images->Add( wxIcon( icons[i] ));
-    }
-
+    wxImageList *p_images = new wxImageList( 16 , 16, TRUE );
+    p_images->Add( wxIcon( type_unknown_xpm ) );
+    p_images->Add( wxIcon( type_disc_xpm ) );
+    p_images->Add( wxIcon( type_directory_xpm ) );
+    p_images->Add( wxIcon( type_playlist_xpm ) );
+    p_images->Add( wxIcon( type_net_xpm ) );
+    p_images->Add( wxIcon( type_card_xpm ) );
     treectrl->AssignImageList( p_images );
 
     treectrl->AddRoot( wxU(_("root" )), -1, -1, NULL );