From 6965b8a59217e5f1db9e5986d6ccc8f5ff5f4e9c Mon Sep 17 00:00:00 2001 From: Eskil Abrahamsen Blomfeldt Date: Wed, 1 Mar 2017 13:29:50 +0100 Subject: 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 Reviewed-by: Konstantin Ritt --- src/gui/text/qdistancefield.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/gui/text/qdistancefield.cpp') 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 scans[128]; + typedef QVarLengthArray ScanLine; + QVarLengthArray scans(height); int first = 0; for (int i = 1; i < indexCount; ++i) { quint32 idx1 = indices[i - 1]; -- cgit v1.2.3