diff options
author | Torbjörn Andersson | 2019-01-04 14:47:36 +0100 |
---|---|---|
committer | Torbjörn Andersson | 2019-01-04 14:47:36 +0100 |
commit | 7394afbbc80be994cea0a83a91fadaf9aeccffdd (patch) | |
tree | 3d30442b6503d6fdd6d8be7e390019954ae3f9a2 | |
parent | f023f28127c00ac510b281581eebd66582a8873e (diff) | |
download | scummvm-rg350-7394afbbc80be994cea0a83a91fadaf9aeccffdd.tar.gz scummvm-rg350-7394afbbc80be994cea0a83a91fadaf9aeccffdd.tar.bz2 scummvm-rg350-7394afbbc80be994cea0a83a91fadaf9aeccffdd.zip |
GLK: Fix negative index crash when clicking in a window
-rw-r--r-- | engines/glk/window_pair.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/engines/glk/window_pair.cpp b/engines/glk/window_pair.cpp index 7ddd57b23c..d571dc58e7 100644 --- a/engines/glk/window_pair.cpp +++ b/engines/glk/window_pair.cpp @@ -245,7 +245,7 @@ void PairWindow::setArrangement(uint method, uint size, Window *keyWin) { } void PairWindow::click(const Point &newPos) { - for (int ctr = 0, idx = (!_backward ? (int)_children.size() - 1 : 0); ctr < (int)_children.size(); + for (int ctr = 0, idx = (_backward ? (int)_children.size() - 1 : 0); ctr < (int)_children.size(); ++ctr, idx += (_backward ? -1 : 1)) { Window *w = _children[idx]; if (w->_bbox.contains(newPos)) |