ref: 3dd7131d4104f935590eff6e0b9b3a51a7a34dff
parent: 7a757b5c2422e9e834914207553463de11dc39a5
author: Simon Howard <[email protected]>
date: Tue Sep 19 17:13:56 EDT 2006
Check column is valid when finding a selectable column. Fixes weird scrolling behavior. Subversion-branch: /trunk/chocolate-doom Subversion-revision: 620
--- a/textscreen/txt_table.c
+++ b/textscreen/txt_table.c
@@ -169,6 +169,11 @@
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)