[Spice-commits] src/channel-cursor.c

Frediano Ziglio fziglio at kemper.freedesktop.org
Wed Jun 7 09:11:50 UTC 2017


 src/channel-cursor.c |    1 +
 1 file changed, 1 insertion(+)

New commits:
commit 8bde48d74fc68745158f9d856cbbe5a20f5eeb1a
Author: Frediano Ziglio <fziglio at redhat.com>
Date:   Wed May 31 14:57:22 2017 +0100

    fix check for 16 bit cursor mask
    
    The size was computed using a 32 bit image while the cursor was
    just 16 bit. This caused the usage of some invalid bit mask (the
    bit mask is used to understand where the cursor is transparent).
    This was clearly visible as the mouse cursor was usually mostly
    black with some apparently random transparent pixels.
    
    Signed-off-by: Frediano Ziglio <fziglio at redhat.com>
    Acked-by: Pavel Grunt <pgrunt at redhat.com>

diff --git a/src/channel-cursor.c b/src/channel-cursor.c
index 2610660..558c920 100644
--- a/src/channel-cursor.c
+++ b/src/channel-cursor.c
@@ -430,6 +430,7 @@ static display_cursor *set_cursor(SpiceChannel *channel, SpiceCursor *scursor)
         }
         break;
     case SPICE_CURSOR_TYPE_COLOR16:
+        size /= 2u;
         for (i = 0; i < hdr->width * hdr->height; i++) {
             pix_mask = get_pix_mask(data, size, i);
             pix = *((guint16*)data + i);


More information about the Spice-commits mailing list