reinstate the empty check, and always initialize the format field
authorreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 8 Dec 2009 22:02:26 +0000 (22:02 +0000)
committerreed@android.com <reed@android.com@2bbb7eff-a529-9590-31e7-b0007b416f81>
Tue, 8 Dec 2009 22:02:26 +0000 (22:02 +0000)
git-svn-id: http://skia.googlecode.com/svn/trunk@453 2bbb7eff-a529-9590-31e7-b0007b416f81

src/core/SkScalerContext.cpp

index 413f06c..b9cd3ac 100644 (file)
@@ -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) {