Received: from eggs.gnu.org ([2001:4830:134:3::10]:46585) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNT8s-0004GA-2k for qemu-devel@nongnu.org; Mon, 16 Feb 2015 16:23:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YNT8r-0008AF-0P for qemu-devel@nongnu.org; Mon, 16 Feb 2015 16:23:46 -0500 Received: from mx1.redhat.com ([209.132.183.28]:49808) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YNT8q-0008A9-Of for qemu-devel@nongnu.org; Mon, 16 Feb 2015 16:23:44 -0500 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t1GLNiYF002339 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Mon, 16 Feb 2015 16:23:44 -0500 From: =?UTF-8?q?Radim=20Kr=C4=8Dm=C3=A1=C5=99?= Date: Mon, 16 Feb 2015 22:23:08 +0100 Message-Id: <1424121788-24560-3-git-send-email-rkrcmar@redhat.com> In-Reply-To: <1424121788-24560-1-git-send-email-rkrcmar@redhat.com> References: <1424121788-24560-1-git-send-email-rkrcmar@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 2/2] qxl: surface0 and ram_header should fit into vram List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Gerd Hoffmann The solution is not perfect, but won't let us do the same error again and has no overhead. Signed-off-by: Radim Kr=C4=8Dm=C3=A1=C5=99 --- hw/display/qxl.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hw/display/qxl.c b/hw/display/qxl.c index 61df47726481..d5e85d033080 100644 --- a/hw/display/qxl.c +++ b/hw/display/qxl.c @@ -367,6 +367,8 @@ static void init_qxl_rom(PCIQXLDevice *d) num_pages -=3D surface0_area_size; num_pages =3D num_pages / QXL_PAGE_SIZE; =20 + assert(surface0_area_size + ram_header_size <=3D d->vga.vram_size); + rom->draw_area_offset =3D cpu_to_le32(0); rom->surface0_area_size =3D cpu_to_le32(surface0_area_size); rom->pages_offset =3D cpu_to_le32(surface0_area_size); --=20 2.3.0