From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:41773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvPeW-0003li-V0 for qemu-devel@nongnu.org; Fri, 13 Jun 2014 07:28:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WvPeQ-0006Dy-Pq for qemu-devel@nongnu.org; Fri, 13 Jun 2014 07:28:12 -0400 Received: from mx1.redhat.com ([209.132.183.28]:31712) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WvPeQ-0006Df-Fv for qemu-devel@nongnu.org; Fri, 13 Jun 2014 07:28:06 -0400 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s5DBS5C1032656 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK) for ; Fri, 13 Jun 2014 07:28:05 -0400 From: Gerd Hoffmann Date: Fri, 13 Jun 2014 13:28:00 +0200 Message-Id: <1402658880-10987-3-git-send-email-kraxel@redhat.com> In-Reply-To: <1402658880-10987-1-git-send-email-kraxel@redhat.com> References: <1402658880-10987-1-git-send-email-kraxel@redhat.com> Subject: [Qemu-devel] [PULL 2/2] 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