diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-12-16 14:21:49 +0100 |
---|---|---|
committer | Jiang Jiang <jiang.jiang@nokia.com> | 2011-12-16 14:38:24 +0100 |
commit | 870c4e7b9ce6143ae48f717265094d4f7e0d2434 (patch) | |
tree | d872aeb0103164d76f67ff7cbd73d2e10b9a4159 | |
parent | 5e07a3ac58f93bd5e09715d43b58c20950c2befa (diff) | |
download | qt4-tools-870c4e7b9ce6143ae48f717265094d4f7e0d2434.tar.gz |
Fix crash in positionInLigature
Check boundary of pos before accessing attributes.
Task-number: QTBUG-23104
Reviewed-by: Eskil
-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 ee2eef62a7..66773c6e3b 100644 --- a/src/gui/text/qtextengine.cpp +++ b/src/gui/text/qtextengine.cpp @@ -2805,7 +2805,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; } |