From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Nrvez-0004La-4M for qemu-devel@nongnu.org; Wed, 17 Mar 2010 11:59:53 -0400 Received: from [199.232.76.173] (port=47304 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Nrvew-0004K4-Bk for qemu-devel@nongnu.org; Wed, 17 Mar 2010 11:59:50 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1Nrveu-0001Ri-S7 for qemu-devel@nongnu.org; Wed, 17 Mar 2010 11:59:50 -0400 Received: from mail-pw0-f45.google.com ([209.85.160.45]:46160) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Nrveu-0001MN-Ez for qemu-devel@nongnu.org; Wed, 17 Mar 2010 11:59:48 -0400 Received: by mail-pw0-f45.google.com with SMTP id 9so827239pwi.4 for ; Wed, 17 Mar 2010 08:59:48 -0700 (PDT) Message-ID: <4BA0FC6E.5090805@codemonkey.ws> Date: Wed, 17 Mar 2010 10:59:42 -0500 From: Anthony Liguori MIME-Version: 1.0 Subject: Re: [Qemu-devel] [PATCH] Fix SIGFPE for vnc display of width/height = 1 References: <20100308143449.GA4084@arachsys.com> In-Reply-To: <20100308143449.GA4084@arachsys.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Chris Webb Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org On 03/08/2010 08:34 AM, Chris Webb wrote: > 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 > Applied. Thanks. Regards, Anthony Liguori > --- > 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; >