diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-11-25 15:15:31 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-11-25 15:15:31 -0800 |
commit | 1b2462846b5deee5b142251cbe2bb7d7c07df41b (patch) | |
tree | 4338992c2fe5d005c0cbbd5d1a68b54eb3fe1709 /fpdfsdk/src/fpdfview.cpp | |
parent | 5c4c193fd4b6dd0657abf5e74125f9887f91d720 (diff) | |
download | pdfium-1b2462846b5deee5b142251cbe2bb7d7c07df41b.tar.xz |
XFA: More underlying types
Precursor to https://codereview.chromium.org/1477583002/
Also:
whitespace in fxjs_v8.h
Merge where possible.
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/1472363003 .
Diffstat (limited to 'fpdfsdk/src/fpdfview.cpp')
-rw-r--r-- | fpdfsdk/src/fpdfview.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/fpdfsdk/src/fpdfview.cpp b/fpdfsdk/src/fpdfview.cpp index adb14cd3b9..2066631e3c 100644 --- a/fpdfsdk/src/fpdfview.cpp +++ b/fpdfsdk/src/fpdfview.cpp @@ -214,9 +214,10 @@ DLLEXPORT void STDCALL FPDF_InitLibraryWithConfig( CFX_GEModule::Get()->SetCodecModule(g_pCodecModule); CPDF_ModuleMgr::Create(); - CPDF_ModuleMgr::Get()->SetCodecModule(g_pCodecModule); - CPDF_ModuleMgr::Get()->InitPageModule(); - CPDF_ModuleMgr::Get()->InitRenderModule(); + CPDF_ModuleMgr* pModuleMgr = CPDF_ModuleMgr::Get(); + pModuleMgr->SetCodecModule(g_pCodecModule); + pModuleMgr->InitPageModule(); + pModuleMgr->InitRenderModule(); CPDFXFA_App::GetInstance()->Initialize(); if (cfg && cfg->version >= 2) IJS_Runtime::Initialize(cfg->m_v8EmbedderSlot, cfg->m_pIsolate); @@ -439,6 +440,7 @@ DLLEXPORT FPDF_PAGE STDCALL FPDF_LoadPage(FPDF_DOCUMENT document, UnderlyingDocumentType* pDoc = UnderlyingFromFPDFDocument(document); if (!pDoc) return nullptr; + if (page_index < 0 || page_index >= pDoc->GetPageCount()) return nullptr; |