[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] Fix SIGFPE for vnc display of width/height = 1
From: |
Chris Webb |
Subject: |
[Qemu-devel] [PATCH] Fix SIGFPE for vnc display of width/height = 1 |
Date: |
Mon, 8 Mar 2010 14:34:49 +0000 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
During boot, the screen gets resized to height 1 and a mouse click at this
point will cause a division by zero when calculating the absolute pointer
position from the pixel (x, y). Return a click in the middle of the screen
instead in this case.
Signed-off-by: Chris Webb <address@hidden>
---
vnc.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/vnc.c b/vnc.c
index 01353a9..676a707 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1457,8 +1457,10 @@ static void pointer_event(VncState *vs, int button_mask,
int x, int y)
dz = 1;
if (vs->absolute) {
- kbd_mouse_event(x * 0x7FFF / (ds_get_width(vs->ds) - 1),
- y * 0x7FFF / (ds_get_height(vs->ds) - 1),
+ kbd_mouse_event(ds_get_width(vs->ds) > 1 ?
+ x * 0x7FFF / (ds_get_width(vs->ds) - 1) : 0x4000,
+ ds_get_height(vs->ds) > 1 ?
+ y * 0x7FFF / (ds_get_height(vs->ds) - 1) : 0x4000,
dz, buttons);
} else if (vnc_has_feature(vs, VNC_FEATURE_POINTER_TYPE_CHANGE)) {
x -= 0x7FFF;
--
1.7.0.1
- [Qemu-devel] Another VNC crash, qemu-kvm-0.12.3, Chris Webb, 2010/03/01
- [Qemu-devel] Re: Another VNC crash, qemu-kvm-0.12.3, Anthony Liguori, 2010/03/03
- [Qemu-devel] Re: Another VNC crash, qemu-kvm-0.12.3, Chris Webb, 2010/03/05
- Re: [Qemu-devel] Re: Another VNC crash, qemu-kvm-0.12.3, Alexander Graf, 2010/03/05
- Re: [Qemu-devel] Re: Another VNC crash, qemu-kvm-0.12.3, Chris Webb, 2010/03/06
- [Qemu-devel] [PATCH] Fix SIGFPE for vnc display of width/height = 1,
Chris Webb <=
- Re: [Qemu-devel] [PATCH] Fix SIGFPE for vnc display of width/height = 1, Chris Webb, 2010/03/08
- Re: [Qemu-devel] [PATCH] Fix SIGFPE for vnc display of width/height = 1, Anthony Liguori, 2010/03/17
- Re: [Qemu-devel] [PATCH] Fix SIGFPE for vnc display of width/height = 1, Alexander Graf, 2010/03/17