Test types of nodes before downcasting them


A bad cast in QSvgMarker::drawHelper lead to an endless recursion
resulting in a heap overflow. Credit to OSS-Fuzz which found this as
issue 496327371.

Amends 534d072fe9c060ca3d1b968a717513426c69c956

While fixing that, I found another, similar case and fixed it, too,
although it didn't seem to cause a crash.

Amends 29b848e9ac4e4e13c5b50116a81b1f2677196939

Pick-to: 6.11 6.8
Change-Id: Ia57491aa329fea981307a709c5a6a750125fe2c7
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
commite488f852fa18c2afc2842a88eff8f66ad4105a45
parentf1f9e15020125a55f7df1927cd9277e331206424
authorRobert Löhning <robert.loehning@qt.io>
committerRobert Löhning <robert.loehning@qt.io>
commit timeThu, 9 Apr 2026 10:22:43 +0200