qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: qemu-devel@nongnu.org
Cc: Marek Vasut <marex@denx.de>
Subject: [Qemu-devel] [PATCH] vmware_vga: Redraw only visible area
Date: Fri, 17 Aug 2012 04:55:07 +0200	[thread overview]
Message-ID: <1345172107-27092-1-git-send-email-marex@denx.de> (raw)

Disallow negative value boundaries of the redraw rectangle.
This fixes a segfault when using -vga vmware.

Signed-off-by: Marek Vasut <marex@denx.de>
---
 hw/vmware_vga.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

NOTE: I tested this by emulating some recent version of ubuntu. The rect->x
      value was set to -65 for some reason at one point, which caused the
      kvm to crash. Trimming the rectangle fixed the issue.

diff --git a/hw/vmware_vga.c b/hw/vmware_vga.c
index f5e4f44..62e5887 100644
--- a/hw/vmware_vga.c
+++ b/hw/vmware_vga.c
@@ -337,8 +337,8 @@ static inline void vmsvga_update_rect_delayed(struct vmsvga_state_s *s,
 {
     struct vmsvga_rect_s *rect = &s->redraw_fifo[s->redraw_fifo_last ++];
     s->redraw_fifo_last &= REDRAW_FIFO_LEN - 1;
-    rect->x = x;
-    rect->y = y;
+    rect->x = (x < 0) ? 0 : x;
+    rect->y = (y < 0) ? 0 : y;
     rect->w = w;
     rect->h = h;
 }
-- 
1.7.10.4

             reply	other threads:[~2012-08-17  2:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-17  2:55 Marek Vasut [this message]
2012-08-17 12:18 ` [Qemu-devel] [PATCH] vmware_vga: Redraw only visible area Michael Tokarev
2012-08-17 12:37   ` Marek Vasut
2012-09-16 20:36     ` Marek Vasut
2012-09-17  4:52       ` Michael Tokarev
2012-09-17 10:15         ` Marek Vasut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345172107-27092-1-git-send-email-marex@denx.de \
    --to=marex@denx.de \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).