summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorRaph Levien <raph@google.com>2014-05-29 14:01:18 -0700
committerRaph Levien <raph@google.com>2014-05-29 14:06:53 -0700
commit0297ee985c26b49fc2a3b0941db354c27f436bbf (patch)
tree4909ef8a6477d86895b648ef29e09976d6d87695 /libs
parent7c382381191b2280b53c375fe83dfc6217bbdfa9 (diff)
downloadandroid_frameworks_minikin-0297ee985c26b49fc2a3b0941db354c27f436bbf.tar.gz
android_frameworks_minikin-0297ee985c26b49fc2a3b0941db354c27f436bbf.tar.bz2
android_frameworks_minikin-0297ee985c26b49fc2a3b0941db354c27f436bbf.zip
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
Diffstat (limited to 'libs')
-rw-r--r--libs/minikin/Layout.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/minikin/Layout.cpp b/libs/minikin/Layout.cpp
index 3935eb7..aba8a1c 100644
--- a/libs/minikin/Layout.cpp
+++ b/libs/minikin/Layout.cpp
@@ -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;
}