From 449f16b2382e08f01e551dd5eeb3ec1e2d3f49f1 Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Mon, 7 Nov 2005 08:16:29 +0000 Subject: [PATCH] Correct the calculation of maskstride. (#320152, Peter Zelezny) 2005-11-07 Tor Lillqvist * gdk/win32/gdkcursor-win32.c (pixbuf_to_hbitmaps_normal): Correct the calculation of maskstride. (#320152, Peter Zelezny) --- ChangeLog | 5 +++++ ChangeLog.pre-2-10 | 5 +++++ gdk/win32/gdkcursor-win32.c | 6 +----- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3bed44b886..8e4615d7bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-11-07 Tor Lillqvist + + * gdk/win32/gdkcursor-win32.c (pixbuf_to_hbitmaps_normal): + Correct the calculation of maskstride. (#320152, Peter Zelezny) + 2005-11-06 Michael Natterer * gtk/Makefile.am (icons): fixed rule to actually create the diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 3bed44b886..8e4615d7bd 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,3 +1,8 @@ +2005-11-07 Tor Lillqvist + + * gdk/win32/gdkcursor-win32.c (pixbuf_to_hbitmaps_normal): + Correct the calculation of maskstride. (#320152, Peter Zelezny) + 2005-11-06 Michael Natterer * gtk/Makefile.am (icons): fixed rule to actually create the diff --git a/gdk/win32/gdkcursor-win32.c b/gdk/win32/gdkcursor-win32.c index d3ff185fa8..ea82597385 100644 --- a/gdk/win32/gdkcursor-win32.c +++ b/gdk/win32/gdkcursor-win32.c @@ -756,11 +756,7 @@ pixbuf_to_hbitmaps_normal (GdkPixbuf *pixbuf, bmstride += 4 - (bmstride % 4); /* MSDN says mask rows are aligned to "LONG" boundaries */ - maskstride = width / 8; - if (maskstride % 4 != 0) - maskstride += 4 - (maskstride % 4); - if (maskstride < 4) /* one word minimum */ - maskstride = 4; + maskstride = (((width + 31) & ~31) >> 3); indata = gdk_pixbuf_get_pixels (pixbuf); rowstride = gdk_pixbuf_get_rowstride (pixbuf);