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-02 07:47:03 +0000 |
commit | 6965b8a59217e5f1db9e5986d6ccc8f5ff5f4e9c (patch) | |
tree | 95c1a6dadf07ca72f16b0094b52c8d15565d88ba /src/gui/text | |
parent | 1a5deb7e0ea9a129d4ebc59677893c7477ad5a3a (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: Id95c0f10d82a1294f7e7a51ac32e88a5a2e0a790
Reviewed-by: Yoann Lopes <yoann.lopes@qt.io>
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Diffstat (limited to 'src/gui/text')
-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 933dd1bf54..064c2aca7f 100644 --- a/src/gui/text/qdistancefield.cpp +++ b/src/gui/text/qdistancefield.cpp @@ -436,8 +436,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]; |