From 74d8621f53c40c093cf3c7e2b3e551dba76d539d 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 e1d6dac. --- CHANGELOG.md | 1 + src/textwin.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7794e2c..ea99f14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ Changelog 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 b698f48..656ac62 100644 --- a/src/textwin.cpp +++ b/src/textwin.cpp @@ -988,7 +988,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); goto done; }