From 23517bfc35ded91b919f49f3709bf8e4b5042987 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Wed, 19 Nov 2014 12:00:18 +0100 Subject: QDistanceField: a zero glyph index means the glyph was not found In qt_fontHasNarrowOutlines, if we proceed to call alphaMapForGlyph when the glyph does not exist, there will be a failed assertion. The docs for FT_Get_Char_Index say that zero means the glyph was not found. Change-Id: I371e9a2797a34fa3ebeae44531af51e24dadad79 Reviewed-by: Konstantin Ritt --- src/gui/text/qdistancefield.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/gui/text/qdistancefield.cpp') diff --git a/src/gui/text/qdistancefield.cpp b/src/gui/text/qdistancefield.cpp index ca6cafb13c..b2d0298e04 100644 --- a/src/gui/text/qdistancefield.cpp +++ b/src/gui/text/qdistancefield.cpp @@ -751,7 +751,7 @@ bool qt_fontHasNarrowOutlines(const QRawFont &f) return false; QVector glyphIndices = font.glyphIndexesForString(QLatin1String("O")); - if (glyphIndices.size() < 1) + if (glyphIndices.isEmpty() || glyphIndices[0] == 0) return false; return imageHasNarrowOutlines(font.alphaMapForGlyph(glyphIndices.at(0), -- cgit v1.2.3