From: Ian Jackson Date: Tue, 24 Mar 2009 18:12:39 +0000 (+0000) Subject: cirrus: Do not clear vram area to 0xff when not yet allocated. X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=545882583159e9cc53cde5965277967092459f37;p=xenclient%2Fioemu.git cirrus: Do not clear vram area to 0xff when not yet allocated. 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 --- diff --git a/hw/cirrus_vga.c b/hw/cirrus_vga.c index 6149a0f9..28b02391 100644 --- a/hw/cirrus_vga.c +++ b/hw/cirrus_vga.c @@ -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;