From 3dd7131d4104f935590eff6e0b9b3a51a7a34dff Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Tue, 19 Sep 2006 21:13:56 +0000 Subject: Check column is valid when finding a selectable column. Fixes weird scrolling behavior. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 620 --- textscreen/txt_table.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'textscreen/txt_table.c') diff --git a/textscreen/txt_table.c b/textscreen/txt_table.c index d1d0777e..b04ce7cb 100644 --- a/textscreen/txt_table.c +++ b/textscreen/txt_table.c @@ -169,6 +169,11 @@ static int SelectableWidget(txt_table_t *table, int x, int y) txt_widget_t *widget; int i; + if (x < 0 || x >= table->columns) + { + return 0; + } + i = y * table->columns + x; if (i >= 0 && i < table->num_widgets) -- cgit v1.2.3