From 8e56fd9728d63a7a48ef44503425c6e25c7c9ffb Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 2 May 2008 10:22:06 +0930 Subject: [PATCH] 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. --- dix/getevents.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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)