diff options
author | Konstantin Ritt <ritt.ks@gmail.com> | 2014-03-03 06:19:25 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-03 11:11:09 +0100 |
commit | 5a7bf123ea7b85f8f3000d274d07df1da1a63413 (patch) | |
tree | 0a1df1b7dbf15e3114609d899e5acb3fcafde1eb /src/gui | |
parent | fd498ad1c0f331a42b8c9ee18f5bb48647d13df1 (diff) |
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>
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/text/qfontengine_qpa.cpp | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/src/gui/text/qfontengine_qpa.cpp b/src/gui/text/qfontengine_qpa.cpp index eb6a97c5f1..3ffc809f75 100644 --- a/src/gui/text/qfontengine_qpa.cpp +++ b/src/gui/text/qfontengine_qpa.cpp @@ -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; } } |