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:
parent
fd498ad1c0
commit
5a7bf123ea
@ -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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user