diff options
author | Jiang Jiang <jiang.jiang@nokia.com> | 2011-12-16 14:21:49 +0100 |
---|---|---|
committer | Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com> | 2012-02-13 11:34:43 +0100 |
commit | 8cb8c42245581d90fcff23912f5d72857b40b8e8 (patch) | |
tree | f2214e94711a4cd915312fd3cb1453718dfcee8b | |
parent | 5b04f9be8c3fdf247b6ef201fcb393ee25ec1708 (diff) |
Fix crash in positionInLigature
Check boundary of pos before accessing attributes.
Task-number: QTBUG-23104
Reviewed-by: Eskil
(cherry picked from commit 9851e6da855357d6c1c17e956ba628aa975f92ce)
Change-Id: I01615d997b01a8d8c10ac5e63380b4a0fe946147
Reviewed-by: Pasi Pentikäinen <ext-pasi.a.pentikainen@nokia.com>
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
-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 2fc1dbd0fc..71cb0e7e98 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; } |