udev: only apply default calibration on absolute devices
authorPeter Hutterer <peter.hutterer@who-t.net>
Fri, 5 Dec 2014 03:41:04 +0000 (13:41 +1000)
committerPeter Hutterer <peter.hutterer@who-t.net>
Fri, 5 Dec 2014 04:04:18 +0000 (14:04 +1000)
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>
src/udev-seat.c

index f7a3df3478f4ab39a692c8aba68ddf408b6d7848..3d05733655d88a59d9c3013cf9b72a41b53de726 100644 (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],