If (*nglyphs < len), stringToCMap() sets *nglyphs to len and returns
false immediately; the caller then must resize the buffer and re-try.
However, QFontEngineMulti::stringToCMap() doesn't update the nglyphs value
and thus the second call would fail, too. This is quite unexpected.
Change-Id: Id2cce7b9faf7706c382fccf023e1b7affa9a10be
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@digia.com>
QGlyphLayout *glyphs, int *nglyphs,
QFontEngine::ShaperFlags flags) const
{
- int ng = *nglyphs;
- if (!engine(0)->stringToCMap(str, len, glyphs, &ng, flags))
+ if (!engine(0)->stringToCMap(str, len, glyphs, nglyphs, flags))
return false;
const_cast<QFontEngineMulti *>(this)->ensureFallbackFamiliesQueried();
++glyph_pos;
}
- *nglyphs = ng;
- glyphs->numGlyphs = ng;
+ *nglyphs = glyph_pos;
+ glyphs->numGlyphs = glyph_pos;
return true;
}