[mutter] iconcache: don't crash on a non-alpha mask pixmap



commit 82db52aaf4bb6a1d58b68724a2ae235c22b6e853
Author: Owen W. Taylor <otaylor fishsoup net>
Date:   Mon Mar 21 18:49:55 2011 -0400

    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 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/src/core/iconcache.c b/src/core/iconcache.c
index d298467..cb3924b 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);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]