path: root/src/gui/text/qfontengine_p.h
diff options
authorEskil Abrahamsen Blomfeldt <>2015-07-10 13:22:32 +0200
committerOswald Buddenhagen <>2015-10-23 08:59:45 +0000
commit0a2f2382541424726168804be2c90b91381608c6 (patch)
tree1e35fbd18f77ac56ff4a38ed419c434504bb187c /src/gui/text/qfontengine_p.h
parentb05d05fd9ce2aeedfaf805a7ed9007a93c902bc9 (diff)
Better handling of invalid font tablesHEAD4.8
Specifically when reading files with broken cmap tables, we could get some undeterministic results. We handle this more gracefully by verifying that the offsets are sane and bailing out early if not. This replaces the current pattern throughout the font engine for consistency. This is a back-port of 4a1e5dbade4bab55f39bd368480dcca9a11e4b38 from Qt 5. Change-Id: If4172b9ef0808801c8e27ffaad962535afe572ed Reviewed-by: Thiago Macieira <> Reviewed-by: Lars Knoll <>
Diffstat (limited to 'src/gui/text/qfontengine_p.h')
1 files changed, 1 insertions, 1 deletions
diff --git a/src/gui/text/qfontengine_p.h b/src/gui/text/qfontengine_p.h
index f29ac47eef..9c3435f9ed 100644
--- a/src/gui/text/qfontengine_p.h
+++ b/src/gui/text/qfontengine_p.h
@@ -247,7 +247,7 @@ public:
QFontEngineGlyphCache *glyphCache(void *key, QFontEngineGlyphCache::Type type, const QTransform &transform) const;
static const uchar *getCMap(const uchar *table, uint tableSize, bool *isSymbolFont, int *cmapSize);
- static quint32 getTrueTypeGlyphIndex(const uchar *cmap, uint unicode);
+ static quint32 getTrueTypeGlyphIndex(const uchar *cmap, int cmapSize, uint unicode);
static QByteArray convertToPostscriptFontFamilyName(const QByteArray &fontFamily);