From: reed@android.com Date: Tue, 8 Dec 2009 22:02:26 +0000 (+0000) Subject: reinstate the empty check, and always initialize the format field X-Git-Tag: submit/tizen/20180928.044319~19304 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b757f8d20c582463999bd7aa5a48110e84945d19;p=platform%2Fupstream%2FlibSkiaSharp.git 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 --- diff --git a/src/core/SkScalerContext.cpp b/src/core/SkScalerContext.cpp index 413f06c1f3..b9cd3aca4c 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) {