diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2017-03-01 13:29:50 +0100 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2017-03-03 08:21:39 +0000 |
commit | 951ead089dcb45510a19f5b309d67c4cbe3de956 (patch) | |
tree | 197b11d6050411f61838405903fdb849e28f844a | |
parent | 27fa5a72c2be24028d8e9b2e83693d564e2be8b9 (diff) |
Fix crash for glyphs with height > 128
In fe97ecf408da60931fc49b502a223d59b5f93f99 we added support for
arbitrarily sized glyphs, since there is no guarantee that a glyph
will fit inside the em square. There was, however, a hardcoded max
size in the distance field generator, so for very tall glyphs we
could potentially get a crash.
[ChangeLog][QtGui][Text] Fixed crash for very tall glyphs
Task-number: QTBUG-57241
Change-Id: I0a9afcc6cc3769543390f0f292519a6fe840689c
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
(cherry picked from commit 6965b8a59217e5f1db9e5986d6ccc8f5ff5f4e9c)
-rw-r--r-- | src/gui/text/qdistancefield.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/text/qdistancefield.cpp b/src/gui/text/qdistancefield.cpp index efe4cc9928..ac55b4c54f 100644 --- a/src/gui/text/qdistancefield.cpp +++ b/src/gui/text/qdistancefield.cpp @@ -428,8 +428,8 @@ static void drawPolygons(qint32 *bits, int width, int height, const QPoint *vert const quint32 *indices, int indexCount, qint32 value) { Q_ASSERT(indexCount != 0); - Q_ASSERT(height <= 128); - QVarLengthArray<quint8, 16> scans[128]; + typedef QVarLengthArray<quint8, 16> ScanLine; + QVarLengthArray<ScanLine, 128> scans(height); int first = 0; for (int i = 1; i < indexCount; ++i) { quint32 idx1 = indices[i - 1]; |