diff options
author | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2016-08-23 12:25:05 +0200 |
---|---|---|
committer | Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io> | 2016-08-24 06:11:07 +0000 |
commit | 660c34077eb97c3aa49671fe555ecca717933e0d (patch) | |
tree | 310062923412c269ad3177f5dcbe1e18abe01638 /src/gui/text | |
parent | 95c767f5be3cd42b4ed79eeed6fd4aa6cc29dc16 (diff) |
DirectWrite: Fix crash when embedding empty glyphs in PDF
Empty QPainterPaths can have one move-to element, so the test
to detect this case was incomplete. For empty glyphs returned
from DirectWrite this would trigger a crash. This is only
reproducible after also enabling embedding of fonts with the
DirectWrite engine.
Task-number: QTBUG-54740
Change-Id: I3fbbfb8d958818550d5ab5234242d39688b84811
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/gui/text')
-rw-r--r-- | src/gui/text/qfontsubset.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qfontsubset.cpp b/src/gui/text/qfontsubset.cpp index 49638832e0..92eeaf7919 100644 --- a/src/gui/text/qfontsubset.cpp +++ b/src/gui/text/qfontsubset.cpp @@ -966,7 +966,7 @@ static QTtfGlyph generateGlyph(int index, const QPainterPath &path, qreal advanc glyph.advanceWidth = qRound(advance * 2048. / ppem); glyph.lsb = qRound(lsb * 2048. / ppem); - if (!path.elementCount()) { + if (path.isEmpty()) { //qDebug("glyph %d is empty", index); lsb = 0; glyph.xMin = glyph.xMax = glyph.yMin = glyph.yMax = 0; |