提交 0297ee98 编写于 作者: R Raph Levien

Fix for Minikin native crash

The context start offset wasn't being taken into account for
accumulating the advance values, leading in some cases to array index
overflow.

This is a fix for bug 15327918 "SIGSEGV in
android::MinikinFontSkia::GetSkTypeface()"

Change-Id: I9b646785724c9b72d862b822cd84661c106fbe52
上级 7c382381
......@@ -661,7 +661,7 @@ void Layout::doLayoutRun(const uint16_t* buf, size_t start, size_t count, size_t
ctx->paint.font->GetBounds(&glyphBounds, glyph_ix, ctx->paint);
glyphBounds.offset(x + xoff, y + yoff);
mBounds.join(glyphBounds);
size_t cluster = info[i].cluster;
size_t cluster = info[i].cluster - start;
mAdvances[cluster] += xAdvance;
x += xAdvance;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册