From aff3e3c4a20aae52fdafaede8dfcbde2bc990104 Mon Sep 17 00:00:00 2001 From: Simon Hausmann Date: Fri, 3 Jan 2014 12:18:19 +0100 Subject: Make texture glyph cache more robust against missing glyphs This fixes failing assertions in the CI system. All the callers of lockedAlphaMapForGlyph always check the return value for being null as well as the image itself, so we need to do the same here as well before calling unlockAlphaMapForGlyph. This is proposed to stable because commit f9399d69add411adf757e3390488ff57655833b7 also landed in stable. Change-Id: I0a4f4fbb1727e5b4ad497b08177d14c81abd2dd0 Reviewed-by: Lars Knoll Reviewed-by: Gunnar Sletta --- src/gui/painting/qtextureglyphcache.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/painting/qtextureglyphcache.cpp b/src/gui/painting/qtextureglyphcache.cpp index b953f8d81f..e340c1e613 100644 --- a/src/gui/painting/qtextureglyphcache.cpp +++ b/src/gui/painting/qtextureglyphcache.cpp @@ -160,7 +160,7 @@ bool QTextureGlyphCache::populate(QFontEngine *fontEngine, int numGlyphs, const // proper metrics will be cached and used later. if (fontEngine->hasInternalCaching()) { QImage *locked = fontEngine->lockedAlphaMapForGlyph(glyph, subPixelPosition, format); - if (locked) + if (locked && !locked->isNull()) fontEngine->unlockAlphaMapForGlyph(); } -- cgit v1.2.3