summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin T. H. Sandsmark <martin.sandsmark@kde.org>2016-11-20 13:04:48 (GMT)
committerKurt Hindenburg <kurt.hindenburg@gmail.com>2016-11-24 14:42:03 (GMT)
commit76453a7df8427048a8ce92169c3dbd172f89798c (patch)
tree5265c190f99bead4c8c7c3f027a0c8823d034e7f
parent8d32afabb564ae124e06e233be5c5300da906aea (diff)
Fix crash with combining characters after several cursorRight() calls
cursorRight() does not resize the _screenLines vector, leading to an assert in QVector when trying to look up the _cuX which is bigger than the amount of characters in the current line. BUG: 372530 (cherry picked from commit 80b9e0775ecc81a4462e932be7ffdb1e5b222a4d)
-rw-r--r--src/Screen.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/Screen.cpp b/src/Screen.cpp
index cc8daa3..d674017 100644
--- a/src/Screen.cpp
+++ b/src/Screen.cpp
@@ -640,7 +640,7 @@ void Screen::displayCharacter(unsigned short c)
return;
}
// Find previous "real character" to try to combine with
- int charToCombineWithX = _cuX;
+ int charToCombineWithX = qMin(_cuX, _screenLines[_cuY].length());
int charToCombineWithY = _cuY;
do {
if (charToCombineWithX > 0) {