summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/Fl_Text_Display.cxx8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/Fl_Text_Display.cxx b/src/Fl_Text_Display.cxx
index 7bd221095..e9f0367bc 100644
--- a/src/Fl_Text_Display.cxx
+++ b/src/Fl_Text_Display.cxx
@@ -3369,9 +3369,13 @@ void Fl_Text_Display::wrapped_line_counter(Fl_Text_Buffer *buf, int startPos,
if (b<lineStart) b = lineStart;
if (!foundBreak) { /* no whitespace, just break at margin */
newLineStart = max(p, buf->next_char(lineStart));
- const char *s = buf->address(b);
colNum++;
- width = measure_proportional_character(s, 0, p+styleBufOffset);
+ if (b >= buf->length()) { // STR #2730
+ width = 0;
+ } else {
+ const char *s = buf->address(b);
+ width = measure_proportional_character(s, 0, p+styleBufOffset);
+ }
}
if (p >= maxPos) {
*retPos = maxPos;