aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-08 19:41:01 +0000
committerGravatar vandebo@chromium.org <vandebo@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>2012-03-08 19:41:01 +0000
commitd41e70de196e78e21e1001d23a7259785cbd0835 (patch)
tree66c68f2cc34af8fcba254357743cdcb3a776bdaf /src
parentf4f2b8010a6e733f0ecbacef4a3ede570dca883a (diff)
[PDF] Treat TTF Fonts that report zero glyphs as other font type.
Fix crbug.com/117322 crash Patch from Arthur Hsu, Original CL: http://codereview.appspot.com/5786057/ Review URL: https://codereview.appspot.com/5792050 git-svn-id: http://skia.googlecode.com/svn/trunk@3345 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src')
-rwxr-xr-xsrc/ports/SkFontHost_win.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ports/SkFontHost_win.cpp b/src/ports/SkFontHost_win.cpp
index ec7e1b00aa..72c311be67 100755
--- a/src/ports/SkFontHost_win.cpp
+++ b/src/ports/SkFontHost_win.cpp
@@ -1100,7 +1100,8 @@ SkAdvancedTypefaceMetrics* SkFontHost::GetAdvancedTypefaceMetrics(
populate_glyph_to_unicode(hdc, glyphCount, &(info->fGlyphToUnicode));
}
- if (otm.otmTextMetrics.tmPitchAndFamily & TMPF_TRUETYPE) {
+ if (glyphCount > 0 &&
+ (otm.otmTextMetrics.tmPitchAndFamily & TMPF_TRUETYPE)) {
info->fType = SkAdvancedTypefaceMetrics::kTrueType_Font;
} else {
info->fType = SkAdvancedTypefaceMetrics::kOther_Font;