From afecbccb0f89e9288c20a06ace8bea998ec3aac7 Mon Sep 17 00:00:00 2001 From: whitequark Date: Sat, 5 Nov 2016 17:04:34 +0000 Subject: [PATCH] OS X: fix another out-of-bounds TW.META access. See also f5a37ae. --- CHANGELOG.md | 1 + src/textwin.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb281d4..39cb699 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -42,6 +42,7 @@ Other new features: Bug fixes: * Do not crash when applying a symmetry constraint to two points. * Fix TTF font metrics again (properly this time). + * Various minor crashes. 2.2 --- diff --git a/src/textwin.cpp b/src/textwin.cpp index c69679b..1e67a15 100644 --- a/src/textwin.cpp +++ b/src/textwin.cpp @@ -1024,7 +1024,7 @@ void TextWindow::MouseEvent(bool leftClick, bool leftDown, double x, double y) { break; } } - if(r < rows && c < MAX_COLS) { + if(r >= 0 && c >= 0 && r < rows && c < MAX_COLS) { SetMousePointerToHand(false); hoveredRow = r;