mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-25 02:30:06 +01:00
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.
(cherry picked from commit 12d27cf33c)
This commit is contained in:
parent
bcd6708895
commit
a964d54128
1 changed files with 1 additions and 1 deletions
|
|
@ -250,7 +250,7 @@ acceleratePointer(DeviceIntPtr pDev, int first_valuator, int num_valuators,
|
|||
}
|
||||
}
|
||||
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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue