X-Git-Url: http://pileus.org/git/?a=blobdiff_plain;f=gtk%2Fgtkquartz.c;h=557fa8ac2c9b4d4153632603354ab0ec3bacaf80;hb=bb3c56abe2e7916126bd4f8234dee080b5381941;hp=3b9558d387ee6edc5c171f47469613eebf00bdc8;hpb=8216324e4b13f0349ed3c0f854d41e6b32d1f0cb;p=~andy%2Fgtk diff --git a/gtk/gtkquartz.c b/gtk/gtkquartz.c index 3b9558d38..557fa8ac2 100644 --- a/gtk/gtkquartz.c +++ b/gtk/gtkquartz.c @@ -13,9 +13,7 @@ * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the - * Free Software Foundation, Inc., 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. + * License along with this library. If not, see . */ #include "config.h" @@ -39,7 +37,7 @@ _gtk_quartz_create_image_from_pixbuf (GdkPixbuf *pixbuf) pixbuf_width = gdk_pixbuf_get_width (pixbuf); pixbuf_height = gdk_pixbuf_get_height (pixbuf); - g_return_val_if_fail (pixbuf_width == 0 && pixbuf_height == 0, NULL); + g_return_val_if_fail (pixbuf_width != 0 && pixbuf_height != 0, NULL); rowstride = gdk_pixbuf_get_rowstride (pixbuf); has_alpha = gdk_pixbuf_get_has_alpha (pixbuf); @@ -60,10 +58,11 @@ _gtk_quartz_create_image_from_pixbuf (GdkPixbuf *pixbuf) nsimage = [[NSImage alloc] initWithSize:NSMakeSize (pixbuf_width, pixbuf_height)]; nsimage_size = [nsimage size]; - if (size.width == 0.0 && size.height == 0.0) + if (nsimage_size.width == 0.0 && nsimage_size.height == 0.0) { [nsimage release]; - g_return_val_if_fail (FALSE, NULL); + g_critical ("%s returned a zero-sized image", G_STRFUNC); + return NULL; } [nsimage lockFocus]; @@ -102,6 +101,7 @@ _gtk_quartz_target_list_to_pasteboard_types (GtkTargetList *target_list) { GtkTargetPair *pair = list->data; gchar *target = gdk_atom_name (pair->target); + g_return_val_if_fail (pair->flags < 16, NULL); [set addObject:target_to_pasteboard_type (target)]; g_free (target); }