[Bf-blender-cvs] [a6ad80d9e85] master: Fix T70125: crash on startup in Linux with some tablet types connected
Brecht Van Lommel
noreply at git.blender.org
Thu Oct 3 15:37:33 CEST 2019
Commit: a6ad80d9e852bb47e435915d9d491819d0947016
Author: Brecht Van Lommel
Date: Thu Oct 3 10:13:17 2019 +0200
Branches: master
https://developer.blender.org/rBa6ad80d9e852bb47e435915d9d491819d0947016
Fix T70125: crash on startup in Linux with some tablet types connected
===================================================================
M intern/ghost/intern/GHOST_SystemX11.cpp
===================================================================
diff --git a/intern/ghost/intern/GHOST_SystemX11.cpp b/intern/ghost/intern/GHOST_SystemX11.cpp
index e46edeeac9a..639553f31bb 100644
--- a/intern/ghost/intern/GHOST_SystemX11.cpp
+++ b/intern/ghost/intern/GHOST_SystemX11.cpp
@@ -2303,26 +2303,30 @@ void GHOST_SystemX11::refreshXInputDevices()
/* Find how many pressure levels tablet has */
XAnyClassPtr ici = device_info[i].inputclassinfo;
- for (int j = 0; j < xtablet.Device->num_classes; ++j) {
- if (ici->c_class == ValuatorClass) {
- XValuatorInfo *xvi = (XValuatorInfo *)ici;
- xtablet.PressureLevels = xvi->axes[2].max_value;
-
- if (xvi->num_axes > 3) {
- /* this is assuming that the tablet has the same tilt resolution in both
- * positive and negative directions. It would be rather weird if it didn't.. */
- xtablet.XtiltLevels = xvi->axes[3].max_value;
- xtablet.YtiltLevels = xvi->axes[4].max_value;
- }
- else {
- xtablet.XtiltLevels = 0;
- xtablet.YtiltLevels = 0;
+ if (ici != NULL) {
+ for (int j = 0; j < xtablet.Device->num_classes; ++j) {
+ if (ici->c_class == ValuatorClass) {
+ XValuatorInfo *xvi = (XValuatorInfo *)ici;
+ if (xvi->axes != NULL) {
+ xtablet.PressureLevels = xvi->axes[2].max_value;
+
+ if (xvi->num_axes > 3) {
+ /* this is assuming that the tablet has the same tilt resolution in both
+ * positive and negative directions. It would be rather weird if it didn't.. */
+ xtablet.XtiltLevels = xvi->axes[3].max_value;
+ xtablet.YtiltLevels = xvi->axes[4].max_value;
+ }
+ else {
+ xtablet.XtiltLevels = 0;
+ xtablet.YtiltLevels = 0;
+ }
+
+ break;
+ }
}
- break;
+ ici = (XAnyClassPtr)(((char *)ici) + ici->length);
}
-
- ici = (XAnyClassPtr)(((char *)ici) + ici->length);
}
m_xtablets.push_back(xtablet);
More information about the Bf-blender-cvs
mailing list