Skip to content

Commit 5c09d60

Browse files
Jean-Baptiste Queruandroid code review
authored andcommitted
Merge "Fix CacheBitmap crash issue when using H/W UI rendering"
2 parents 2415841 + ee30963 commit 5c09d60

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libs/hwui/FontRenderer.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,7 @@ void FontRenderer::cacheBitmap(const SkGlyph& glyph, CachedGlyphInfo* cachedGlyp
617617
uint32_t* retOriginX, uint32_t* retOriginY) {
618618
cachedGlyph->mIsValid = false;
619619
// If the glyph is too tall, don't cache it
620-
if (glyph.fHeight + TEXTURE_BORDER_SIZE > mCacheLines[mCacheLines.size() - 1]->mMaxHeight) {
620+
if (mCacheLines.size() != 0 && (glyph.fHeight + TEXTURE_BORDER_SIZE > mCacheLines[mCacheLines.size() - 1]->mMaxHeight)) {
621621
ALOGE("Font size to large to fit in cache. width, height = %i, %i",
622622
(int) glyph.fWidth, (int) glyph.fHeight);
623623
return;

0 commit comments

Comments
 (0)