diff --git a/hw/vga.c b/hw/vga.c
-index e4e27a9..c8d9077 100644
+index e4e27a9..21ea2ac 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -638,6 +638,12 @@ static void vbe_ioport_write_data(void *opaque, uint32_t addr, uint32_t val)
s->vbe_regs[VBE_DISPI_INDEX_VIRT_WIDTH] =
s->vbe_regs[VBE_DISPI_INDEX_XRES];
s->vbe_regs[VBE_DISPI_INDEX_VIRT_HEIGHT] =
-@@ -1313,6 +1319,7 @@ static void vga_draw_text(VGAState *s, int full_update)
- cw != s->last_cw || cheight != s->last_ch || s->last_depth) {
- s->last_scr_width = width * cw;
- s->last_scr_height = height * cheight;
+@@ -1610,6 +1616,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
+ disp_width != s->last_width ||
+ height != s->last_height ||
+ s->last_depth != depth) {
+ memset(s->vram_ptr + (s->start_addr * 4), 0x00, s->line_offset * height);
- qemu_console_resize(s->ds, s->last_scr_width, s->last_scr_height);
- s->last_depth = 0;
- s->last_width = width;
-@@ -1626,6 +1633,7 @@ static void vga_draw_graphic(VGAState *s, int full_update)
- } else {
- qemu_console_resize(s->ds, disp_width, height);
- }
-+ memset(s->vram_ptr + (s->start_addr * 4), 0x00, s->line_offset * height);
- s->last_scr_width = disp_width;
- s->last_scr_height = height;
- s->last_width = disp_width;
+ if (depth == 32) {
+ if (is_graphic_console()) {
+ qemu_free_displaysurface(s->ds);