From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35591) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuL6w-0006xN-Gm for qemu-devel@nongnu.org; Tue, 10 Jun 2014 08:25:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WuL6p-0001j9-I4 for qemu-devel@nongnu.org; Tue, 10 Jun 2014 08:25:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:23204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WuL6p-0001iv-9n for qemu-devel@nongnu.org; Tue, 10 Jun 2014 08:24:59 -0400 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5ACOwHm001582 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Tue, 10 Jun 2014 08:24:58 -0400 From: Gerd Hoffmann Date: Tue, 10 Jun 2014 14:24:45 +0200 Message-Id: <1402403085-18054-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PATCH] qxl-render: add sanity check List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann Verify dirty rectangle is completely within the primary surface, just ignore it in case it isn't. Signed-off-by: Gerd Hoffmann --- hw/display/qxl-render.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/hw/display/qxl-render.c b/hw/display/qxl-render.c index 84f1367..cc2c2b1 100644 --- a/hw/display/qxl-render.c +++ b/hw/display/qxl-render.c @@ -138,6 +138,12 @@ static void qxl_render_update_area_unlocked(PCIQXLDevice *qxl) if (qemu_spice_rect_is_empty(qxl->dirty+i)) { break; } + if (qxl->dirty[i].left > qxl->dirty[i].right || + qxl->dirty[i].top > qxl->dirty[i].bottom || + qxl->dirty[i].right > qxl->guest_primary.surface.width || + qxl->dirty[i].bottom > qxl->guest_primary.surface.height) { + continue; + } qxl_blit(qxl, qxl->dirty+i); dpy_gfx_update(vga->con, qxl->dirty[i].left, qxl->dirty[i].top, -- 1.8.3.1