udev: only apply default calibration on absolute devices

Fixes a crash if the LIBINPUT_CALIBRATION_MATRIX is set for a relative device.

https://bugs.freedesktop.org/show_bug.cgi?id=86993

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Jonas Ådahl <jadahl@gmail.com>
This commit is contained in:
Peter Hutterer 2014-12-05 13:41:04 +10:00
parent 1affca8d44
commit f933636143

View file

@ -93,7 +93,8 @@ device_added(struct udev_device *udev_device,
udev_device_get_property_value(udev_device,
"LIBINPUT_CALIBRATION_MATRIX");
if (calibration_values && sscanf(calibration_values,
if (device->abs.absinfo_x && device->abs.absinfo_y &&
calibration_values && sscanf(calibration_values,
"%f %f %f %f %f %f",
&calibration[0],
&calibration[1],