QSvgFontStyle: Limit font weights earlier to avoid overflows
Since we limit the values anyway, we can easily do this before using
them for calculations.
I thought about removing the qBound() at the end and having it in
all three branches of the "if" condition, instead. I chose not to
do that because it could change the value states.fontWeight has
when leaving this function - with whatever implications that might
have. The changes I made are supposed to not change any values or
behavior except for avoiding the overflows.
Credit to OSS-Fuzz which found this as issue 510580899.
Pick-to: 6.11 6.8
Change-Id: I41600755453f72602686ec8cf718a634da8d7215
Reviewed-by: Hatem ElKharashy <hatem.elkharashy@qt.io>