Fix QFontEngineQPA::recalcAdvances() in case of missing glyph

Modifying the glyph indexes array in recalcAdvances() could lead
to undefined behavior.

Change-Id: Ibbb6642f381a5fe01b285dc8d2001c167dc66f46
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This commit is contained in:
Konstantin Ritt 2014-03-03 06:19:25 +02:00 committed by The Qt Project
parent fd498ad1c0
commit 5a7bf123ea

View File

@ -390,10 +390,8 @@ void QFontEngineQPA::recalcAdvances(QGlyphLayout *glyphs, QFontEngine::ShaperFla
{
for (int i = 0; i < glyphs->numGlyphs; ++i) {
const Glyph *g = findGlyph(glyphs->glyphs[i]);
if (!g) {
glyphs->glyphs[i] = 0;
if (!g)
continue;
}
glyphs->advances[i] = g->advance;
}
}