dix: don't allow for devices with 0 axes

This just makes the existing behavior explicit, previously we relied on
a malloc(numAxes * ...) to return NULL to error out.
This commit is contained in:
Peter Hutterer 2024-01-04 10:31:51 +10:00
parent 5f48efa2bd
commit 7aba2514b2

View File

@ -1335,6 +1335,7 @@ InitValuatorClassDeviceStruct(DeviceIntPtr dev, int numAxes, Atom *labels,
ValuatorClassPtr valc; ValuatorClassPtr valc;
BUG_RETURN_VAL(dev == NULL, FALSE); BUG_RETURN_VAL(dev == NULL, FALSE);
BUG_RETURN_VAL(numAxes == 0, FALSE);
if (numAxes > MAX_VALUATORS) { if (numAxes > MAX_VALUATORS) {
LogMessage(X_WARNING, LogMessage(X_WARNING,