summaryrefslogtreecommitdiff
path: root/src/xf86Wacom.c
diff options
context:
space:
mode:
authorBruno Vasselle <bruno.vasselle@laposte.net>2011-02-25 08:31:21 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-02-25 08:33:28 +1000
commit577f42d38b66fd84594a6d3f2932a559e68b5751 (patch)
tree382bad41c8809303aa0f5863c47e95a56f2b0db1 /src/xf86Wacom.c
parent240e694d861fe78d516f43f315dbe2b634368131 (diff)
downloadxf86-input-wacom-577f42d38b66fd84594a6d3f2932a559e68b5751.tar.gz
Division by zero in wcmInitArea when KEEP_SHAPE_FLAG is on.
Under some circumstances, wcmInitArea faces a division by zero when trying to deal with the "KeepShape" option. The patch disables KeepShape in the situation. Signed-off-by: Bruno Vasselle <bruno.vasselle@laposte.net> Acked-by: Ping Cheng <pinglinux@gmail.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/xf86Wacom.c')
-rw-r--r--src/xf86Wacom.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/xf86Wacom.c b/src/xf86Wacom.c
index e8c4710..a5fc7a2 100644
--- a/src/xf86Wacom.c
+++ b/src/xf86Wacom.c
@@ -116,6 +116,15 @@ static int wcmInitArea(InputInfoPtr pInfo)
/* Maintain aspect ratio to the whole desktop
* May need to consider a specific screen in multimonitor settings
*/
+ if ((priv->flags & KEEP_SHAPE_FLAG) &&
+ (priv->maxHeight == 0)) /* safeguard in case screen ratio is unknown */
+ {
+ xf86Msg(X_WARNING,
+ "%s: disabling option \"KeepShape\" as screen shape is not accessible\n",
+ pInfo->name);
+ priv->flags &= ~KEEP_SHAPE_FLAG;
+ }
+
if (priv->flags & KEEP_SHAPE_FLAG)
{