diff --git a/src/synaptics.c b/src/synaptics.c index 77eb5be..d2fabeb 100644 --- a/src/synaptics.c +++ b/src/synaptics.c @@ -2996,6 +2996,8 @@ UpdateTouchState(InputInfoPtr pInfo, struct SynapticsHwState *hw) for (i = 0; i < hw->num_mt_mask; i++) { + assert(priv->num_active_touches >= 0); + assert(priv->num_active_touches <= priv->num_slots); if (hw->slot_state[i] == SLOTSTATE_OPEN) { priv->open_slots[priv->num_active_touches] = i; @@ -3016,6 +3018,8 @@ UpdateTouchState(InputInfoPtr pInfo, struct SynapticsHwState *hw) priv->num_active_touches--; } + assert(priv->num_active_touches >= 0); + assert(priv->num_active_touches <= priv->num_slots); } SynapticsResetTouchHwState(hw, FALSE);