be more careful in IVAS

Don't walk off the end of a NULL pointer in InitValuatorAxisStruct.
This commit is contained in:
Daniel Stone 2006-07-20 18:40:47 -04:00 committed by Daniel Stone
parent 7711c56d2e
commit d32dc8bf19

View File

@ -302,7 +302,12 @@ _X_EXPORT void
InitValuatorAxisStruct(DeviceIntPtr dev, int axnum, int minval, int maxval,
int resolution, int min_res, int max_res)
{
register AxisInfoPtr ax = dev->valuator->axes + axnum;
register AxisInfoPtr ax;
if (!dev || !dev->valuator)
return NULL;
ax = dev->valuator->axes + axnum;
ax->min_value = minval;
ax->max_value = maxval;