summaryrefslogtreecommitdiff
path: root/gtk/gtkdnd-quartz.c
diff options
context:
space:
mode:
authorJohn Ralls <jralls@ceridwen.us>2011-11-07 14:25:08 -0800
committerJohn Ralls <jralls@ceridwen.us>2011-11-07 14:25:08 -0800
commit085b98f47031bb48f84fde2ee2cd6618acfdacfc (patch)
treec9d285838c0803fede93f6f3fedf22145b5d9214 /gtk/gtkdnd-quartz.c
parent42656dde57ac1b661ff0692ed210617ec49d34c0 (diff)
downloadgtk+-085b98f47031bb48f84fde2ee2cd6618acfdacfc.tar.gz
[Quartz Bug 663182] NSImage throws an exception from _gtk_quartz_create_image_from_pixbuf()"
If a zero-sized NSImage calls lockfocus it throws an exception. Make sure that the image isn't zero-sized before calling lockfocus, and log a warning and return NULL if it is zero-sized. Have the quartz version of gtk_drag_begin_idle return FALSE if the returned image is NULL.
Diffstat (limited to 'gtk/gtkdnd-quartz.c')
-rw-r--r--gtk/gtkdnd-quartz.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/gtk/gtkdnd-quartz.c b/gtk/gtkdnd-quartz.c
index 0653261c65..90506c1b9e 100644
--- a/gtk/gtkdnd-quartz.c
+++ b/gtk/gtkdnd-quartz.c
@@ -1081,6 +1081,11 @@ gtk_drag_begin_idle (gpointer arg)
point = [info->nsevent locationInWindow];
drag_image = _gtk_quartz_create_image_from_pixbuf (info->icon_pixbuf);
+ if (drag_image == NULL)
+ {
+ g_object_unref (info->context);
+ return FALSE;
+ }
point.x -= info->hot_x;
point.y -= info->hot_y;