diff mbox

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

Message ID 1239096832-25757-1-git-send-email-avi@redhat.com (mailing list archive)
State Not Applicable
Headers show

Commit Message

Avi Kivity April 7, 2009, 9:33 a.m. UTC
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.

Signed-off-by: Avi Kivity <avi@redhat.com>
---
 hw/vga.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

Comments

Anthony Liguori April 7, 2009, 8:56 p.m. UTC | #1
Avi Kivity wrote:
> 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.
>
> Signed-off-by: Avi Kivity <avi@redhat.com>
>   

Applied.  Thanks.

Regards,

Anthony Liguori

> ---
>  hw/vga.c |    1 +
>  1 files changed, 1 insertions(+), 0 deletions(-)
>
> diff --git a/hw/vga.c b/hw/vga.c
> index b1e4373..4d1049b 100644
> --- a/hw/vga.c
> +++ b/hw/vga.c
> @@ -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);
>  }
>
diff mbox

Patch

diff --git a/hw/vga.c b/hw/vga.c
index b1e4373..4d1049b 100644
--- a/hw/vga.c
+++ b/hw/vga.c
@@ -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);
 }