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
|
static void
|
||||||
clipAxis(DeviceIntPtr pDev, int axisNum, int *val)
|
clipAxis(DeviceIntPtr pDev, int axisNum, int *val)
|
||||||
{
|
{
|
||||||
AxisInfoPtr axis = pDev->valuator->axes + axisNum;
|
AxisInfoPtr axis;
|
||||||
/* InitValuatoraAxisStruct ensures that (min < max). */
|
|
||||||
|
|
||||||
if (axisNum >= pDev->valuator->numAxes)
|
if (axisNum >= pDev->valuator->numAxes)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
axis = pDev->valuator->axes + axisNum;
|
||||||
|
|
||||||
/* If a value range is defined, clip. If not, do nothing */
|
/* If a value range is defined, clip. If not, do nothing */
|
||||||
if (axis->max_value <= axis->min_value)
|
if (axis->max_value <= axis->min_value)
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in New Issue