diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-12-16 13:21:49 (GMT) |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-12-16 13:39:34 (GMT) |
commit | 9851e6da855357d6c1c17e956ba628aa975f92ce (patch) | |
tree | 195f3f0326f3f2391ab1b1f4f84e2c419c9bad6c /src/gui | |
parent | c614e71cdd4047bb49ccde2f94c9d622f5071fc3 (diff) | |
download | Qt-9851e6da855357d6c1c17e956ba628aa975f92ce.zip Qt-9851e6da855357d6c1c17e956ba628aa975f92ce.tar.gz Qt-9851e6da855357d6c1c17e956ba628aa975f92ce.tar.bz2 |
Fix crash in positionInLigature
Check boundary of pos before accessing attributes.
Task-number: QTBUG-23104
Reviewed-by: Eskil
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qtextengine.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qtextengine.cpp b/src/gui/text/qtextengine.cpp index 2fc1dbd..71cb0e7 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2912,7 +2912,7 @@ int QTextEngine::positionInLigature(const QScriptItem *si, int end, closestItem--; int pos = si->position + clusterStart + closestItem; // Jump to the next charStop - while (!attrs[pos].charStop && pos < end) + while (pos < end && !attrs[pos].charStop) pos++; return pos; } |