[gtk+/gtk-2-18] Allocate a large-enough and mask
- From: Matthias Clasen <matthiasc src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtk+/gtk-2-18] Allocate a large-enough and mask
- Date: Tue, 1 Dec 2009 04:09:17 +0000 (UTC)
commit 066c3c42dd01950ea56f5ed514e6ca14dd443cae
Author: Matthias Clasen <mclasen redhat com>
Date: Fri Nov 27 20:57:59 2009 -0500
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.
(cherry picked from commit 869ee7f232d2afcf2c08003e4f279e21b58b9581)
gdk-pixbuf/io-ico.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/gdk-pixbuf/io-ico.c b/gdk-pixbuf/io-ico.c
index 4a6bad8..e7fedb9 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]