Skip to contentSkip to conversation

Fix crash on resolution change -> screen dump -> vga redraw

PATCH Applied Avi Kivity 2 participants 2 messages Apr 7, 2009 KVM

lore
Share & tools
lore

Avi Kivity

author
#0 lore raw

PATCH 1/1 Fix crash on resolution change -> screen dump -> vga redraw

The vga screen dump function updates last_width and last_height, but does not change the DisplaySurface that these variables describe. A consequent vga_draw_graphic() will therefore fail to resize the surface and crash.

Fix by invalidating the display state after a screen dump, forcing vga_draw_graphic() to reallocate the DisplaySurface.

---
 hw/vga.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
hw/vga.c +1 -0
index b1e4373..4d1049b 100644
@@ -2678,4 +2678,5 @@ static void vga_screen_dump(void *opaque, const char *filename)
         vga_screen_dump_graphic(s, filename);
     else
         vga_screen_dump_text(s, filename);
+    vga_invalidate_display(s);
 }
Signature · 1 line
1.6.0.6
#1 lore raw
Quoted 10 lines · Avi Kivity

The vga screen dump function updates last_width and last_height, but does not change the DisplaySurface that these variables describe. A consequent vga_draw_graphic() will therefore fail to resize the surface and crash.

Fix by invalidating the display state after a screen dump, forcing vga_draw_graphic() to reallocate the DisplaySurface.

Applied. Thanks.

Regards,

Anthony Liguori

Quoted 15 lines
---
 hw/vga.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
hw/vga.c +1 -0
index b1e4373..4d1049b 100644
@@ -2678,4 +2678,5 @@ static void vga_screen_dump(void *opaque, const char *filename)
         vga_screen_dump_graphic(s, filename);
     else
         vga_screen_dump_text(s, filename);
+    vga_invalidate_display(s);
 }
Signature · 3 lines
Regards,

Anthony Liguori