diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com> | 2014-05-15 13:32:27 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-28 16:52:04 +0200 |
commit | 909b0de5d16f2af3b3d6a3ca4c7e53b84836ad37 (patch) | |
tree | 07fa654820332e52af54c51c6be35054315246bd /tests/auto/gui/text | |
parent | 3478ec29494c315c4e41f25a1265da928503694b (diff) | |
download | qtbase-909b0de5d16f2af3b3d6a3ca4c7e53b84836ad37.tar.gz |
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 <ritt.ks@gmail.com>
Diffstat (limited to 'tests/auto/gui/text')
-rw-r--r-- | tests/auto/gui/text/qrawfont/tst_qrawfont.cpp | 5 |
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); QVERIFY(!font.isValid()); + + invalidData.fill(255, 1024); + font.loadFromData(invalidData, 10, QFont::PreferDefaultHinting); + + QVERIFY(!font.isValid()); } #endif // QT_NO_RAWFONT |