]> git.sesse.net Git - vlc/commitdiff
macosx: fix crash when re-ordering playlist items
authorFelix Paul Kühne <fkuehne@videolan.org>
Thu, 6 Dec 2012 06:05:57 +0000 (17:05 +1100)
committerFelix Paul Kühne <fkuehne@videolan.org>
Thu, 6 Dec 2012 06:05:57 +0000 (17:05 +1100)
modules/gui/macosx/playlist.m

index ee1d06aadac62f32b896c833a1fdf4c1c632382c..b1531a9e7ea83c8cf5eea9c8d78eca0e8ae6a4a1 100644 (file)
 
     /* Drag & Drop inside the playlist */
     if ([[o_pasteboard types] containsObject: @"VLCPlaylistItemPboardType"]) {
+        if (index == -1) // this is no valid target, sanitize to top of table
+            index = 0;
+
         int i_row = 0;
         playlist_item_t *p_new_parent, *p_item = NULL;
         NSArray *o_all_items = [o_nodes_array arrayByAddingObjectsFromArray: o_items_array];