Don't read beyond limit in QSvgPaintEngine::drawPath


Because both of the two nested loops increment i, they could increment
it beyond p.elementCount(). I chose to only decrement i in this exact
case to avoid breaking other cases when refactoring the function.

Credit and thanks to Mike Kuta for reporting this issue together with a
test and detailed analysis.

Fixes: QTBUG-145372
Pick-to: 6.11
Change-Id: I451c06e09088c78677ad1377f93e271c41d72422
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
commit7bbc6a383489f2009cc2f0a5365ee1fe7e44d770
parent719f948de6d0c5b90ac861e04b409f561720988f
authorRobert Löhning <robert.loehning@qt.io>
committerRobert Löhning <robert.loehning@qt.io>
commit timeMon, 13 Apr 2026 20:39:27 +0000