aboutsummaryrefslogtreecommitdiff
path: root/input.c
diff options
context:
space:
mode:
Diffstat (limited to 'input.c')
-rw-r--r--input.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/input.c b/input.c
index e075bf4b..c18e24c8 100644
--- a/input.c
+++ b/input.c
@@ -307,6 +307,9 @@ wl_pointer_motion(void *data, struct wl_pointer *wl_pointer,
int col = x / term->cell_width;
int row = y / term->cell_height;
+ if (col < 0 || row < 0 || col >= term->cols || row >= term->rows)
+ return;
+
bool update_selection = term->mouse.button == BTN_LEFT;
bool update_selection_early = term->selection.end.row == -1;