[prev in list] [next in list] [prev in thread] [next in thread] 

List:       freedesktop-xorg-devel
Subject:    [RFC PATCH xserver] xwayland: Fix non-argb cursor conversion
From:       Olivier Fourdan <ofourdan () redhat ! com>
Date:       2017-09-27 16:01:01
Message-ID: 20170927160101.26676-1-ofourdan () redhat ! com
[Download RAW message or body]

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=103012
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
---
 Note: I am not familiar with this so I have no idea whether or not the
 fix is correct (thus the RFC), but it does fix the test case provided
 in bug 103012.

 hw/xwayland/xwayland-cursor.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c
index c95f4e830..cf8395f1d 100644
--- a/hw/xwayland/xwayland-cursor.c
+++ b/hw/xwayland/xwayland-cursor.c
@@ -42,7 +42,7 @@ expand_source_and_mask(CursorPtr cursor, CARD32 *data)
         (cursor->foreGreen & 0xff00) | (cursor->foreGreen >> 8);
     bg = ((cursor->backRed & 0xff00) << 8) |
         (cursor->backGreen & 0xff00) | (cursor->backGreen >> 8);
-    stride = (bits->width / 8 + 3) & ~3;
+    stride = BitmapBytePad(bits->width);
     for (y = 0; y < bits->height; y++)
         for (x = 0; x < bits->width; x++) {
             i = y * stride + x / 8;
-- 
2.13.5

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: https://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic