diff options
author | Fabrice Di Meglio <fdimeglio@google.com> | 2011-05-18 12:50:34 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2011-05-18 12:50:34 -0700 |
commit | 41701ac5f694074a41e3f1d2e0a889e8af792a37 (patch) | |
tree | 99ebd39c0ffb43edc06c8021593e61ae44518b9d /core/jni/android | |
parent | fb03c4fafee3a5bd6a26ec0b85162b45fd9dd57e (diff) | |
parent | 78b868ff42cc368c45f851443678a822560dc266 (diff) | |
download | frameworks_base-41701ac5f694074a41e3f1d2e0a889e8af792a37.zip frameworks_base-41701ac5f694074a41e3f1d2e0a889e8af792a37.tar.gz frameworks_base-41701ac5f694074a41e3f1d2e0a889e8af792a37.tar.bz2 |
Merge "Fix bug #4441002 Crash in SkPathEffectGlue::OneD_constructor"
Diffstat (limited to 'core/jni/android')
-rw-r--r-- | core/jni/android/graphics/TextLayoutCache.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/core/jni/android/graphics/TextLayoutCache.cpp b/core/jni/android/graphics/TextLayoutCache.cpp index 26aa7d9..a5b2006 100644 --- a/core/jni/android/graphics/TextLayoutCache.cpp +++ b/core/jni/android/graphics/TextLayoutCache.cpp @@ -547,6 +547,25 @@ void TextLayoutCacheValue::computeRunValuesWithHarfbuzz(SkPaint* paint, const UC LOGD(" -- isDevKernText=%d", paint->isDevKernText()); #endif + if (shaperItem.advances == NULL || shaperItem.num_glyphs == 0) { +#if DEBUG_GLYPHS + LOGD("HARFBUZZ -- advances array is empty or num_glypth = 0"); +#endif + for (size_t i = 0; i < count; i++) { + outAdvances[i] = 0; + } + *outTotalAdvance = 0; + + if (outGlyphs) { + *outGlyphsCount = 0; + *outGlyphs = new jchar[0]; + } + + // Cleaning + deleteGlyphArrays(&shaperItem); + HB_FreeFace(shaperItem.face); + return; + } // Get Advances and their total jfloat totalAdvance = outAdvances[0] = HBFixedToFloat(shaperItem.advances[shaperItem.log_clusters[0]]); for (size_t i = 1; i < count; i++) { |