summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/synaptics.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 27a37d7..0472197 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -974,12 +974,13 @@ SynapticsReset(SynapticsPrivate * priv)
priv->circ_scroll_on = FALSE;
priv->circ_scroll_vert = FALSE;
priv->mid_emu_state = MBE_OFF;
priv->lastButtons = 0;
priv->prev_z = 0;
priv->prevFingers = 0;
+ priv->num_active_touches = 0;
memset(priv->open_slots, 0, priv->num_slots * sizeof(int));
}
static int
DeviceOff(DeviceIntPtr dev)
{
@@ -2608,12 +2609,13 @@ UpdateTouchState(InputInfoPtr pInfo, struct SynapticsHwState *hw)
int i;
for (i = 0; i < hw->num_mt_mask; i++) {
if (hw->slot_state[i] == SLOTSTATE_OPEN) {
priv->open_slots[priv->num_active_touches] = i;
priv->num_active_touches++;
+ BUG_WARN(priv->num_active_touches > priv->num_slots);
}
else if (hw->slot_state[i] == SLOTSTATE_CLOSE) {
Bool found = FALSE;
int j;
for (j = 0; j < priv->num_active_touches - 1; j++) {