Guard against excessive width and height in patternImage()


This fixes two related issues:

- The calculated width and height could overflow when converting them
from qreal to int in qCeil(). Credit to OSS-Fuzz which found this as
issue 553133837. Both now get limited to int's maximum value.

- Excessive sizes could cause running out of memory because
QImageReader's allocation limit wasn't respected in an SVG image's
loading phase. That behavior was introduced with
00984ee2895a1065c03e088255ef0e2bcd690b5d.

Pick-to: 6.12 6.8
Change-Id: Ia757377e1776f096f008e534475de48be2b14f57
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>
commit2ed30cc1c7c9dcf6dbb7b3647fac1e52ef8e46a1
parentd3c0f4bb78d6e205a4497060d478eb341f3040e1
authorRobert Löhning <robert.loehning@qt.io>
committerRobert Löhning <robert.loehning@qt.io>
commit timeTue, 6 Oct 2026 11:57:25 +0000