The VNC code reads this memory before it is written by BIOS or
other code. Avoid random values by setting the VRAM to 0.

This bug was reported by Valgrind.

Signed-off-by: Stefan Weil <[email protected]>
---
 hw/vga.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/vga.c b/hw/vga.c
index 1469680..80b8ec3 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -2283,6 +2283,7 @@ void vga_common_init(VGACommonState *s, int vga_ram_size)
         s->update_retrace_info = vga_precise_update_retrace_info;
         break;
     }
+    memset(s->vram_ptr, 0, s->vram_size);
     vga_dirty_log_start(s);
 }
 
-- 
1.7.10


Reply via email to