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:
parent
f29e55448b
commit
5295aab4e6
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user