From 7fb17c0ba0cc551317569baafa44b4785c8f23d9 Mon Sep 17 00:00:00 2001 From: caryclark Date: Thu, 7 Jul 2016 07:55:50 -0700 Subject: set font cache if null testing/corpus/fx/path/path_10_jd.pdf sets the document to null. (It can't be read at all by MacOS Preview.) This causes the font cache to also be null. In this case, get the font cache from CFX_GEModule instead. R=dsinclair@chromium.org Review-Url: https://codereview.chromium.org/2128043004 --- core/fxge/skia/fx_skia_device.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/core/fxge/skia/fx_skia_device.cpp b/core/fxge/skia/fx_skia_device.cpp index 222c8466e0..55fe580086 100644 --- a/core/fxge/skia/fx_skia_device.cpp +++ b/core/fxge/skia/fx_skia_device.cpp @@ -896,6 +896,8 @@ FX_BOOL CFX_SkiaDeviceDriver::DrawDeviceText(int nChars, const CFX_Matrix* pObject2Device, FX_FLOAT font_size, uint32_t color) { + if (!pCache) + pCache = CFX_GEModule::Get()->GetFontCache(); if (m_pCache->DrawText(nChars, pCharPos, pFont, pCache, pObject2Device, font_size, color, this)) { return TRUE; -- cgit v1.2.3