diff options
author | Simon Thum <simon.thum@gmx.de> | 2009-09-21 15:23:27 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2009-09-22 16:26:14 +1000 |
commit | 824a09d856a5f750694e11d2fd2faaa3de705eaa (patch) | |
tree | e24bb0bd78f19ed2958b4962dd09c2241f055803 | |
parent | 9edb9e9b4dde6f73dc5241d078425a7a70699ec9 (diff) |
dix: move bounds check before access
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r-- | dix/getevents.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/dix/getevents.c b/dix/getevents.c index 7ddf88bad..5224d31eb 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -578,12 +578,13 @@ GetMaximumEventsNum(void) { static void clipAxis(DeviceIntPtr pDev, int axisNum, int *val) { - AxisInfoPtr axis = pDev->valuator->axes + axisNum; - /* InitValuatoraAxisStruct ensures that (min < max). */ + AxisInfoPtr axis; if (axisNum >= pDev->valuator->numAxes) return; + axis = pDev->valuator->axes + axisNum; + /* If a value range is defined, clip. If not, do nothing */ if (axis->max_value <= axis->min_value) return; |