dix: move bounds check before access
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
9edb9e9b4d
commit
824a09d856
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue