From ef38283688c1ee7c08bcf4204cfb78e09c039782 Mon Sep 17 00:00:00 2001 From: art-snake Date: Thu, 20 Oct 2016 13:29:45 -0700 Subject: Fix loading page using hint tables. When linearized document have hint table, The FPDFAvail_IsPageAvail return true, but FPDF_LoadPage return nullptr, for non first pages. This happens, bacause document not use hint tables, to load page. To fix this, I force save the page's ObjNum in document. R=npm, dsinclair Review-Url: https://chromiumcodereview.appspot.com/2437773003 --- core/fpdfapi/parser/cpdf_document.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'core/fpdfapi/parser/cpdf_document.cpp') diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp index c5f64a790c..5f64c14d31 100644 --- a/core/fpdfapi/parser/cpdf_document.cpp +++ b/core/fpdfapi/parser/cpdf_document.cpp @@ -425,7 +425,9 @@ CPDF_Document::CPDF_Document(std::unique_ptr pParser) CPDF_Document::~CPDF_Document() { delete m_pDocPage; - CPDF_ModuleMgr::Get()->GetPageModule()->ClearStockFont(this); + if (CPDF_ModuleMgr::Get()->GetPageModule()) { + CPDF_ModuleMgr::Get()->GetPageModule()->ClearStockFont(this); + } m_pByteStringPool.DeleteObject(); // Make weak. } -- cgit v1.2.3