qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH 2/2] qxl: surface0 and ram_header should fit into vr


From: Radim Krčmář
Subject: [Qemu-devel] [PATCH 2/2] qxl: surface0 and ram_header should fit into vram
Date: Mon, 16 Feb 2015 22:23:08 +0100

The solution is not perfect, but won't let us do the same error again
and has no overhead.

Signed-off-by: Radim Krčmář <address@hidden>
---
 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         -= surface0_area_size;
     num_pages          = num_pages / QXL_PAGE_SIZE;
 
+    assert(surface0_area_size + ram_header_size <= d->vga.vram_size);
+
     rom->draw_area_offset   = cpu_to_le32(0);
     rom->surface0_area_size = cpu_to_le32(surface0_area_size);
     rom->pages_offset       = cpu_to_le32(surface0_area_size);
-- 
2.3.0




reply via email to

[Prev in Thread] Current Thread [Next in Thread]