From a82eed18e5a9d0984d607127bddc95f5f8690803 Mon Sep 17 00:00:00 2001 From: Greg Ercolano Date: Sat, 1 Oct 2016 21:22:20 +0000 Subject: Bringing over fix [r12000] from 1.3 current to the porting branch. Applying my suggested patch to solve immediate issues with STR #3231. Probably more needs to be done (see STR), but at least solves the immediate issues. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12001 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/Fl_Text_Display.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx index 4d2b8bdd8..e3a2b8947 100644 --- a/src/Fl_Text_Display.cxx +++ b/src/Fl_Text_Display.cxx @@ -1027,7 +1027,9 @@ int Fl_Text_Display::position_to_xy( int pos, int* X, int* Y ) const { int lineStartPos, fontHeight; int visLineNum; /* If position is not displayed, return false */ - if (pos < mFirstChar || (pos > mLastChar && !empty_vlines())) { + if ((pos < mFirstChar) || + (pos > mLastChar && !empty_vlines()) || + (pos > buffer()->length()) ) { // STR #3231 return (*X=*Y=0); // make sure X & Y are set when it is out of view } -- cgit v1.2.3