Fix crash in raster on X11 when text contains unsupported characters
authorEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Thu, 28 Apr 2011 13:05:08 +0000 (15:05 +0200)
committerEskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@nokia.com>
Fri, 29 Apr 2011 07:05:26 +0000 (09:05 +0200)
We would assume the font engine was a FT engine and do a static cast
here, which would cause a crash if the box engine was in use instead.

Task-number: QTBUG-17443
Reviewed-by: Samuel
(cherry picked from commit c9c54682bcd23598ac7a8db3b10e9f18c978e268)

src/gui/painting/qtextureglyphcache.cpp

index 53f025f..e9e56a2 100644 (file)
@@ -296,7 +296,7 @@ void QTextureGlyphCache::fillInPendingGlyphs()
 QImage QTextureGlyphCache::textureMapForGlyph(glyph_t g, QFixed subPixelPosition) const
 {
 #if defined(Q_WS_X11)
-    if (m_transform.type() > QTransform::TxTranslate) {
+    if (m_transform.type() > QTransform::TxTranslate && m_current_fontengine->type() == QFontEngine::Freetype) {
         QFontEngineFT::GlyphFormat format = QFontEngineFT::Format_None;
         QImage::Format imageFormat = QImage::Format_Invalid;
         switch (m_type) {