Guarantee QTextEngine::findItem() returns -1 for invalid strPos
authorKonstantin Ritt <ritt.ks@gmail.com>
Wed, 21 May 2014 23:39:44 +0000 (02:39 +0300)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Fri, 23 May 2014 10:10:13 +0000 (12:10 +0200)
commitbe0bfe09ee4b99e9ab45c6898949b5d144e77a29
tree50f7dda7cbcc4a11cfea9be7cbd800908388fe53
parent9b3b33b11027d0dd013447c3b59939712c432249
Guarantee QTextEngine::findItem() returns -1 for invalid strPos

...and check the returned value where it may cause undefined behavior
(i.e. negative amount of items or iteration from -1 to n).

Change-Id: Ib7bd9ab178526df45b792ad48b91ebbab6be861a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
src/gui/text/qtextengine.cpp
src/gui/text/qtextlayout.cpp