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:38:24 (GMT) |
commit | 870c4e7b9ce6143ae48f717265094d4f7e0d2434 (patch) | |
tree | d872aeb0103164d76f67ff7cbd73d2e10b9a4159 /src | |
parent | 5e07a3ac58f93bd5e09715d43b58c20950c2befa (diff) | |
download | Qt-870c4e7b9ce6143ae48f717265094d4f7e0d2434.zip Qt-870c4e7b9ce6143ae48f717265094d4f7e0d2434.tar.gz Qt-870c4e7b9ce6143ae48f717265094d4f7e0d2434.tar.bz2 |
Fix crash in positionInLigature
Check boundary of pos before accessing attributes.
Task-number: QTBUG-23104
Reviewed-by: Eskil
Diffstat (limited to 'src')
-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 ee2eef6..66773c6 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; } |