From 82db52aaf4bb6a1d58b68724a2ae235c22b6e853 Mon Sep 17 00:00:00 2001 From: "Owen W. Taylor" Date: Mon, 21 Mar 2011 18:49:55 -0400 Subject: [PATCH] iconcache: don't crash on a non-alpha mask pixmap We assume when applying a mask that it is a depth-1 pixmap that cairo interprets as alpha. So ignore a non-depth-1 mask. https://bugzilla.gnome.org/show_bug.cgi?id=641975 --- src/core/iconcache.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/iconcache.c b/src/core/iconcache.c index d29846720..cb3924b16 100644 --- a/src/core/iconcache.c +++ b/src/core/iconcache.c @@ -434,10 +434,11 @@ try_pixmap_and_mask (MetaDisplay *display, if (unscaled && src_mask != None) { - get_pixmap_geometry (display, src_mask, &w, &h, NULL); - mask = meta_gdk_pixbuf_get_from_pixmap (src_mask, - 0, 0, - w, h); + get_pixmap_geometry (display, src_mask, &w, &h, &d); + if (d == 1) + mask = meta_gdk_pixbuf_get_from_pixmap (src_mask, + 0, 0, + w, h); } meta_error_trap_pop (display);