summaryrefslogtreecommitdiffstats
path: root/src/gui/text
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-11-19 12:00:18 +0100
committerKonstantin Ritt <ritt.ks@gmail.com>2014-11-25 22:18:23 +0100
commit23517bfc35ded91b919f49f3709bf8e4b5042987 (patch)
treec8ecc9b70a4e82c0d828cddee0781866cd8a325e /src/gui/text
parent0e0464c50d96dcf576e525f750cd96f8afa7784b (diff)
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 <ritt.ks@gmail.com>
Diffstat (limited to 'src/gui/text')
-rw-r--r--src/gui/text/qdistancefield.cpp2
1 files changed, 1 insertions, 1 deletions
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<quint32> glyphIndices = font.glyphIndexesForString(QLatin1String("O"));
- if (glyphIndices.size() < 1)
+ if (glyphIndices.isEmpty() || glyphIndices[0] == 0)
return false;
return imageHasNarrowOutlines(font.alphaMapForGlyph(glyphIndices.at(0),