summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2011-02-28 03:41:08 -0500
committerAlberts Muktupāvels <alberts.muktupavels@gmail.com>2016-05-23 23:34:23 +0300
commite2ee54b388d9c3e7eaee45b07609b1e586159db6 (patch)
tree3926d62ee40d1a81973b9314753f284093a1dacc
parent660c569398797d3dfc7b8a777bc5a6d60f90c497 (diff)
downloadmetacity-e2ee54b388d9c3e7eaee45b07609b1e586159db6.tar.gz
iconcache: Fix apply_mask
apply_mask made some wrong assumptions that became untrue after rendering_cleanup landed, such as the number of channels in the pixmap, causing corruption. https://bugzilla.gnome.org/show_bug.cgi?id=641975
-rw-r--r--src/core/iconcache.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/src/core/iconcache.c b/src/core/iconcache.c
index f8ee61ee..2978d4d4 100644
--- a/src/core/iconcache.c
+++ b/src/core/iconcache.c
@@ -350,16 +350,10 @@ apply_mask (GdkPixbuf *pixbuf,
j = 0;
while (j < w)
{
- guchar *s = src + i * src_stride + j * 3;
+ guchar *s = src + i * src_stride + j * 4;
guchar *d = dest + i * dest_stride + j * 4;
- /* s[0] == s[1] == s[2], they are 255 if the bit was set, 0
- * otherwise
- */
- if (s[0] == 0)
- d[3] = 0; /* transparent */
- else
- d[3] = 255; /* opaque */
+ d[3] = s[3];
++j;
}