Windows: Harden QRawFont loading of fonts
When loading a font through QRawFont, we would directly dereference
the offset we get from the table directory for the OS/2 table.
It was not possible to make the application crash, since both
DirectWrite and GDI already protect against poison data in the
table directory, but for extra robustness, we should also check
against this in Qt. This also adds a test to verify that broken
OS/2 table cannot make the application crash. Note that this test
also passed before the fix, as the system would refuse to load the
font to begin with.
Pick-to: 6.12
Task-number: QTBUG-151514
Change-Id: I817364630234ff80d1ec78e0b1e12063c691d6a8
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>