summaryrefslogtreecommitdiff
path: root/dix
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2008-05-02 10:22:06 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2008-05-02 10:22:06 +0930
commit8e56fd9728d63a7a48ef44503425c6e25c7c9ffb (patch)
treeaaea72a24559cf8daafc4d0015788b6fe1649e59 /dix
parenta0e6a7d4f507c5c0a0b11adb10394af58a0a6e07 (diff)
dix: continue to check for invalid valuator ranges.
In an ideal world, the drivers would init all axes with NO_AXIS_LIMIT. In the real world, this is an ABI break, so let's just leave the old check in.
Diffstat (limited to 'dix')
-rw-r--r--dix/getevents.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/dix/getevents.c b/dix/getevents.c
index 6f25fe822..414e27e21 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -358,7 +358,14 @@ clipAxis(DeviceIntPtr pDev, int axisNum, int *val)
{
AxisInfoPtr axis = pDev->valuator->axes + axisNum;
- /* InitValuatoraAxisStruct ensures that (min < max) */
+ /* InitValuatoraAxisStruct ensures that (min < max). */
+
+
+ /* FIXME: drivers need to be updated, evdev e.g. inits axes as min = 0 and
+ * max = -1. Leave this extra check until the drivers have been updated.
+ */
+ if (axis->max_value < axis->min_value)
+ return;
if (axis->min_value != NO_AXIS_LIMITS &&
*val < axis->min_value)