summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorOlivier Fourdan <ofourdan@redhat.com>2017-09-27 18:01:01 +0200
committerAdam Jackson <ajax@redhat.com>2017-12-13 10:08:45 -0500
commitf9a55653721980e3921083015ffb39f777606828 (patch)
tree45481c56897bc615226b551ebfd2c985fe1f18cf /hw
parentb832dac751f81d803d33df7c4dd929f77a69c7b0 (diff)
xwayland: Fix non-argb cursor conversion
From the bug: "What happens if bits->width is less than 8? :)" Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=103012 Signed-off-by: Olivier Fourdan <ofourdan@redhat.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> (cherry picked from commit 97ac59b1ed3624f7c04e54dd3e3dadfa46a8f170)
Diffstat (limited to 'hw')
-rw-r--r--hw/xwayland/xwayland-cursor.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/hw/xwayland/xwayland-cursor.c b/hw/xwayland/xwayland-cursor.c
index f334f1ca5..7b6a698fd 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;