path: root/tests
diff options
authorEskil Abrahamsen Blomfeldt <>2014-05-15 13:32:27 +0200
committerThe Qt Project <>2014-05-28 16:52:04 +0200
commit909b0de5d16f2af3b3d6a3ca4c7e53b84836ad37 (patch)
tree07fa654820332e52af54c51c6be35054315246bd /tests
parent3478ec29494c315c4e41f25a1265da928503694b (diff)
Windows: Fix another crash when creating QRawFont from invalid data
The sanity check added in d16508a285a5423ae9a5034e969801bce74ffb98 didn't actually catch the case where the invalid data is large enough to contain the offset table and table directory. Added sanity checks to all the code that accesses the font data now, so this should fix crashes with partial data as well as invalid data. Task-number: QTBUG-37190 Change-Id: Ie43f10d8cf0b09007783b9b1c4d91bfed8c6b0f0 Reviewed-by: Konstantin Ritt <>
Diffstat (limited to 'tests')
1 files changed, 5 insertions, 0 deletions
diff --git a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
index 20bfaf99dd..a39277b093 100644
--- a/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
+++ b/tests/auto/gui/text/qrawfont/tst_qrawfont.cpp
@@ -948,6 +948,11 @@ void tst_QRawFont::rawFontFromInvalidData()
font.loadFromData(invalidData, 10, QFont::PreferDefaultHinting);
+ invalidData.fill(255, 1024);
+ font.loadFromData(invalidData, 10, QFont::PreferDefaultHinting);
+ QVERIFY(!font.isValid());
#endif // QT_NO_RAWFONT