[vlc-commits] macosx: fix crash when re-ordering playlist items

Felix Paul Kühne git at videolan.org
Thu Dec 6 23:35:24 CET 2012


vlc/vlc-2.0 | branch: master | Felix Paul Kühne <fkuehne at videolan.org> | Thu Dec  6 17:05:57 2012 +1100| [98ed53293f534573928cae6f06be84f8e4c6fffa] | committer: Felix Paul Kühne

macosx: fix crash when re-ordering playlist items
(cherry picked from commit a0442893663ac58aa5b5e8cb098951a0aa499878)

Conflicts:
	modules/gui/macosx/playlist.m

> http://git.videolan.org/gitweb.cgi/vlc/vlc-2.0.git/?a=commit;h=98ed53293f534573928cae6f06be84f8e4c6fffa
---

 modules/gui/macosx/playlist.m |    6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/modules/gui/macosx/playlist.m b/modules/gui/macosx/playlist.m
index 9794764..a97bc14 100644
--- a/modules/gui/macosx/playlist.m
+++ b/modules/gui/macosx/playlist.m
@@ -1544,8 +1544,10 @@
     NSPasteboard *o_pasteboard = [info draggingPasteboard];
 
     /* Drag & Drop inside the playlist */
-    if( [[o_pasteboard types] containsObject: @"VLCPlaylistItemPboardType"] )
-    {
+    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];



More information about the vlc-commits mailing list