xserver: Branch 'master'

Matthieu Herrb herrb at kemper.freedesktop.org
Thu Aug 23 12:59:45 PDT 2007


 dix/getevents.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

New commits:
diff-tree 12d27cf33c6d963eae77795c0d247175907162a5 (from ff089e6cae634ac3eb509abd448a250bcbb17275)
Author: Otto Moerbeek <otto at openbsd.org>
Date:   Thu Aug 23 21:59:25 2007 +0200

    A high resolution device that's moving fast can potentially generate
    an int overflow, making dx*dx+dy*dy negative. Now pow(negative,
    non-integer) yields NaN, so you loose.  Use fp math to avoid that.

diff --git a/dix/getevents.c b/dix/getevents.c
index 2a10038..52b74bd 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -250,7 +250,7 @@ acceleratePointer(DeviceIntPtr pDev, int
             }
         }
         else {
-            mult = pow((float)(dx * dx + dy * dy),
+		mult = pow((float)((float)dx * (float)dx + (float)dy * (float)dy),
                        ((float)(pDev->ptrfeed->ctrl.num) /
                         (float)(pDev->ptrfeed->ctrl.den) - 1.0) /
                        2.0) / 2.0;


More information about the xorg-commit mailing list