Commit 9e236b06 authored by Dominik Röttsches's avatar Dominik Röttsches Committed by Commit Bot

Skip returning fallback font if SkFontMgr unavailable

Work around a crash reported in issue 1022968 occurring mostly on Windows
7 SP1 systems where SkFontMgr is unable to get instantiated. If that
happens, do not attempt calling matchFamilyStyleCharacter() on a null
SkFontMgr.

Bug: 1022968
Change-Id: I5358fe982ba85c65285b965a816a16f94aa11287
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1911783Reviewed-by: default avatarKoji Ishii <kojii@chromium.org>
Commit-Queue: Dominik Röttsches <drott@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714461}
parent 8df15ddf
......@@ -517,12 +517,15 @@ void DWriteFontProxyImpl::FallbackFamilyAndStyleForCodepoint(
/* width */ 0,
/* slant */ 0));
if (!codepoint)
if (!codepoint || !collection_ || !factory_)
return;
sk_sp<SkFontMgr> font_mgr(
SkFontMgr_New_DirectWrite(factory_.Get(), collection_.Get()));
if (!font_mgr)
return;
const char* bcp47_locales[] = {locale_name.c_str()};
int num_locales = locale_name.empty() ? 0 : 1;
const char** locales = locale_name.empty() ? nullptr : bcp47_locales;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment