From: Sven Schnelle Date: Sat, 8 Aug 2020 18:51:57 +0000 (+0200) Subject: hw/display/artist: Fix invalidation of lines near screen border X-Git-Tag: v5.2.0~228^2 X-Git-Url: https://git.proxmox.com/?a=commitdiff_plain;h=2f8cd515477edab1cbf38ecbdbfa2cac13ce1550;p=mirror_qemu.git hw/display/artist: Fix invalidation of lines near screen border If parts of the invalidated screen lines are outside of the VRAM buffer, the code skips the whole invalidate. This is incorrect when only parts of the buffer are invisble - which is the case when the mouse cursor is located near the screen border. Signed-off-by: Sven Schnelle Signed-off-by: Helge Deller --- diff --git a/hw/display/artist.c b/hw/display/artist.c index a959b2c158..71982559c6 100644 --- a/hw/display/artist.c +++ b/hw/display/artist.c @@ -206,7 +206,12 @@ static void artist_invalidate_lines(struct vram_buffer *buf, int starty, int height) { int start = starty * buf->width; - int size = height * buf->width; + int size; + + if (starty + height > buf->height) + height = buf->height - starty; + + size = height * buf->width; if (start + size <= buf->size) { memory_region_set_dirty(&buf->mr, start, size);