From b757f8d20c582463999bd7aa5a48110e84945d19 Mon Sep 17 00:00:00 2001 From: "reed@android.com" Date: Tue, 8 Dec 2009 22:02:26 +0000 Subject: [PATCH] reinstate the empty check, and always initialize the format field git-svn-id: http://skia.googlecode.com/svn/trunk@453 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/core/SkScalerContext.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp index 413f06c1f..b9cd3aca4 100644 --- a/src/core/SkScalerContext.cpp +++ b/src/core/SkScalerContext.cpp @@ -319,7 +319,7 @@ void SkScalerContext::getMetrics(SkGlyph* glyph) { SkIRect ir; devPath.getBounds().roundOut(&ir); - if (!ir.is16Bit()) { + if (ir.isEmpty() || !ir.is16Bit()) { goto SK_ERROR; } glyph->fLeft = ir.fLeft; @@ -356,6 +356,9 @@ SK_ERROR: glyph->fTop = 0; glyph->fWidth = 0; glyph->fHeight = 0; + // put a valid value here, in case it was earlier set to + // MASK_FORMAT_JUST_ADVANCE + glyph->fMaskFormat = fRec.fMaskFormat; } void SkScalerContext::getImage(const SkGlyph& origGlyph) {