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>