Svg: Check target type before casting to QSvgPoly*


...instead of casting to both possible types
when only one of those will be used anyway.

OSS-Fuzz found this as issue 387378125.

Credit to OSS-Fuzz

Change-Id: I187c4638cd00ac16da42e9be22d1a0d430860684
Reviewed-by: Matthias Rauter <matthias.rauter@qt.io>
Reviewed-by: Lena Biliaieva <lena.biliaieva@qt.io>
commitb327776a0c7f3160332265256ed561b1d958bfaf
parentcb917fc84fdddbfd548b13d660033bf377a2c658
authorRobert Löhning <robert.loehning@qt.io>
committerRobert Löhning <robert.loehning@qt.io>
commit timeTue, 21 Jan 2025 15:06:37 +0100