diff options
-rw-r--r-- | chrome/browser/zygote_main_linux.cc | 2 | ||||
-rw-r--r-- | chrome/renderer/render_process_impl.cc | 16 |
2 files changed, 10 insertions, 8 deletions
diff --git a/chrome/browser/zygote_main_linux.cc b/chrome/browser/zygote_main_linux.cc index 6b6a8f9..cceb9bf 100644 --- a/chrome/browser/zygote_main_linux.cc +++ b/chrome/browser/zygote_main_linux.cc @@ -539,7 +539,7 @@ static void PreSandboxInit() { file_util::PathExists(pdf)) { static scoped_refptr<NPAPI::PluginLib> pdf_lib = NPAPI::PluginLib::CreatePluginLib(pdf); - bool rv = pdf_lib->EnsureAlwaysLoaded(); + bool rv = pdf_lib && pdf_lib->EnsureAlwaysLoaded(); DCHECK(rv) << "Couldn't load PDF plugin"; } } diff --git a/chrome/renderer/render_process_impl.cc b/chrome/renderer/render_process_impl.cc index 090317a..b1b6bc6 100644 --- a/chrome/renderer/render_process_impl.cc +++ b/chrome/renderer/render_process_impl.cc @@ -188,16 +188,18 @@ RenderProcessImpl::RenderProcessImpl() file_util::PathExists(pdf)) { static scoped_refptr<NPAPI::PluginLib> pdf_lib = NPAPI::PluginLib::CreatePluginLib(pdf); - bool rv = pdf_lib->EnsureAlwaysLoaded(); + bool rv = pdf_lib && pdf_lib->EnsureAlwaysLoaded(); DCHECK(rv) << "Couldn't load PDF plugin"; #if defined(OS_WIN) - g_iat_patch_createdca.Patch( - pdf_lib->plugin_info().path.value().c_str(), - "gdi32.dll", "CreateDCA", CreateDCAPatch); - g_iat_patch_get_font_data.Patch( - pdf_lib->plugin_info().path.value().c_str(), - "gdi32.dll", "GetFontData", GetFontDataPatch); + if (rv) { + g_iat_patch_createdca.Patch( + pdf_lib->plugin_info().path.value().c_str(), + "gdi32.dll", "CreateDCA", CreateDCAPatch); + g_iat_patch_get_font_data.Patch( + pdf_lib->plugin_info().path.value().c_str(), + "gdi32.dll", "GetFontData", GetFontDataPatch); + } #endif } #endif |