diff options
author | noamsml@chromium.org <noamsml@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-08 04:03:47 +0000 |
---|---|---|
committer | noamsml@chromium.org <noamsml@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-07-08 04:03:47 +0000 |
commit | 977e3dc5efe93ad9c16ed82e4d1afb53a43340cf (patch) | |
tree | fdd8cd3f2ed63769088ead5859bcbe4112e39cf0 /pdf | |
parent | 39412e6a5911f772679361a321f384975d688cbb (diff) | |
download | chromium_src-977e3dc5efe93ad9c16ed82e4d1afb53a43340cf.zip chromium_src-977e3dc5efe93ad9c16ed82e4d1afb53a43340cf.tar.gz chromium_src-977e3dc5efe93ad9c16ed82e4d1afb53a43340cf.tar.bz2 |
Disable font mapping when pepper API is not initialized
For cases such as Privet local printing when the pepper API is not initialized,
disable font mapping to prevent it from crashing.
BUG=391977
Review URL: https://codereview.chromium.org/378733002
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@281653 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'pdf')
-rw-r--r-- | pdf/pdfium/pdfium_engine.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/pdf/pdfium/pdfium_engine.cc b/pdf/pdfium/pdfium_engine.cc index ba3df44..c1203bb 100644 --- a/pdf/pdfium/pdfium_engine.cc +++ b/pdf/pdfium/pdfium_engine.cc @@ -204,6 +204,12 @@ const PDFFontSubstitution PDFFontSubstitutions[] = { void* MapFont(struct _FPDF_SYSFONTINFO*, int weight, int italic, int charset, int pitch_family, const char* face, int* exact) { + // Do not attempt to map fonts if pepper is not initialized (for privet local + // printing). + // TODO(noamsml): Real font substitution (http://crbug.com/391978) + if (!pp::Module::Get()) + return NULL; + pp::BrowserFontDescription description; // Pretend the system does not have the Symbol font to force a fallback to |