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>