Fix crash in positionInLigature

Check boundary of pos before accessing attributes.

Task-number: QTBUG-23104
Change-Id: I0bc93dbe320badc65acc75bb59b27f481e69b93e
Reviewed-by: Eskil
Reviewed-by: Jiang Jiang <jiang.jiang@nokia.com>
This commit is contained in:
Jiang Jiang 2011-12-16 14:21:49 +01:00 committed by Qt by Nokia
parent f29e55448b
commit 5295aab4e6

View File

@ -2692,7 +2692,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;
}