summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_document.cpp
diff options
context:
space:
mode:
authorart-snake <art-snake@yandex-team.ru>2016-10-20 13:29:45 -0700
committerCommit bot <commit-bot@chromium.org>2016-10-20 13:29:45 -0700
commitef38283688c1ee7c08bcf4204cfb78e09c039782 (patch)
treee610f19e8b9a3a13b50a4f9a1b37ac33d1b21433 /core/fpdfapi/parser/cpdf_document.cpp
parent7403f8a2a0d87179a1ccd57ceccd2d84fa59c319 (diff)
downloadpdfium-ef38283688c1ee7c08bcf4204cfb78e09c039782.tar.xz
Fix loading page using hint tables.chromium/2897
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
Diffstat (limited to 'core/fpdfapi/parser/cpdf_document.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_document.cpp4
1 files changed, 3 insertions, 1 deletions
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<CPDF_Parser> 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.
}