]> xenbits.xen.org Git - xenclient/ioemu.git/commitdiff
cirrus: Do not clear vram area to 0xff when not yet allocated.
authorIan Jackson <ian.jackson@eu.citrix.com>
Tue, 24 Mar 2009 18:12:39 +0000 (18:12 +0000)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Tue, 24 Mar 2009 18:12:39 +0000 (18:12 +0000)
When restoring, the vram data pointer is not valid until (depending on
the version of the savefile) the guest has informed us what memory to
use.  Thus vram_ptr may be NULL.  In this patch we avoid attempting to
clear the video ram in this case.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
hw/cirrus_vga.c

index 6149a0f9ffd0ea1e0215ec17eb687197131d8ff1..28b0239179b8f4b4a1f8fe125d8fb0545745180a 100644 (file)
@@ -3194,9 +3194,10 @@ static void cirrus_reset(void *opaque)
     }
     s->cr[0x27] = s->device_id;
 
-    /* Win2K seems to assume that the pattern buffer is at 0xff
-       initially ! */
-    memset(s->vram_ptr, 0xff, s->real_vram_size);
+    if (s->vram_ptr)
+        /* Win2K seems to assume that the pattern buffer is at 0xff
+           initially ! */
+        memset(s->vram_ptr, 0xff, s->real_vram_size);
 
     s->cirrus_hidden_dac_lockindex = 5;
     s->cirrus_hidden_dac_data = 0;