summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOwen W. Taylor <otaylor@fishsoup.net>2011-03-21 18:49:55 -0400
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-05-23 23:34:23 +0300
commit06a2ea4c32375ff2956a6fcce765c6d912cc1b34 (patch)
treebbae2a281e1edb68aca696f746395b8e14b0f35e
parenta2250539217fba3ba906961901e6133b01189eea (diff)
downloadmetacity-06a2ea4c32375ff2956a6fcce765c6d912cc1b34.tar.gz
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
-rw-r--r--src/core/iconcache.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/core/iconcache.c b/src/core/iconcache.c
index 4647ca88..8c5b9cab 100644
--- a/src/core/iconcache.c
+++ b/src/core/iconcache.c
@@ -432,10 +432,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, FALSE);