summaryrefslogtreecommitdiff
path: root/gdk-pixbuf
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2009-11-27 20:57:59 -0500
committerMatthias Clasen <mclasen@redhat.com>2009-11-27 20:59:42 -0500
commit869ee7f232d2afcf2c08003e4f279e21b58b9581 (patch)
tree11d83994fb82f69ac53496fca3991fe4f684438d /gdk-pixbuf
parent36ca3fd5e9106a241e833942f96549af21554580 (diff)
downloadgdk-pixbuf-869ee7f232d2afcf2c08003e4f279e21b58b9581.tar.gz
Allocate a large-enough and mask
We came up short when the image width is not a multiple of 8. Bug 585383, fix by Felix Riemann.
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r--gdk-pixbuf/io-ico.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c
index 4a6bad870..e7fedb929 100644
--- a/gdk-pixbuf/io-ico.c
+++ b/gdk-pixbuf/io-ico.c
@@ -1011,12 +1011,12 @@ fill_entry (IconEntry *icon,
return FALSE;
}
- if ((icon->xor_rowstride % 4) != 0)
+ if ((icon->xor_rowstride % 4) != 0)
icon->xor_rowstride = 4 * ((icon->xor_rowstride / 4) + 1);
icon->xor = g_new0 (guchar, icon->xor_rowstride * icon->height);
- icon->and_rowstride = icon->width / 8;
- if ((icon->and_rowstride % 4) != 0)
+ icon->and_rowstride = (icon->width + 7) / 8;
+ if ((icon->and_rowstride % 4) != 0)
icon->and_rowstride = 4 * ((icon->and_rowstride / 4) + 1);
icon->and = g_new0 (guchar, icon->and_rowstride * icon->height);