diff options
-rw-r--r-- | core/fpdfapi/parser/cpdf_document.cpp | 12 | ||||
-rw-r--r-- | core/fpdfapi/parser/cpdf_document.h | 4 |
2 files changed, 6 insertions, 10 deletions
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp index 311e017148..2a825d7a9e 100644 --- a/core/fpdfapi/parser/cpdf_document.cpp +++ b/core/fpdfapi/parser/cpdf_document.cpp @@ -37,7 +37,7 @@ namespace { -const int FX_MAX_PAGE_LEVEL = 1024; +const int kMaxPageLevel = 1024; void InsertWidthArrayImpl(std::vector<int> widths, CPDF_Array* pWidthArray) { size_t i; @@ -184,11 +184,7 @@ std::unique_ptr<CPDF_Dictionary> CalculateFontDesc( } // namespace CPDF_Document::CPDF_Document() - : ParsedObjectsHolder(), - m_pRootDict(nullptr), - m_iNextPageToTraverse(0), - m_bReachedMaxPageLevel(false), - m_pDocPage(pdfium::MakeUnique<CPDF_DocPageData>(this)), + : m_pDocPage(pdfium::MakeUnique<CPDF_DocPageData>(this)), m_pDocRender(pdfium::MakeUnique<CPDF_DocRenderData>(this)) {} CPDF_Document::~CPDF_Document() { @@ -265,7 +261,7 @@ CPDF_Dictionary* CPDF_Document::TraversePDFPages(int iPage, m_PageList[iPage] = pPages->GetObjNum(); return pPages; } - if (level >= FX_MAX_PAGE_LEVEL) { + if (level >= kMaxPageLevel) { m_pTreeTraversal.pop_back(); m_bReachedMaxPageLevel = true; return nullptr; @@ -390,7 +386,7 @@ int CPDF_Document::FindPageIndex(const CPDF_Dictionary* pNode, if (!pKidList) return -1; - if (level >= FX_MAX_PAGE_LEVEL) + if (level >= kMaxPageLevel) return -1; size_t count = pNode->GetIntegerFor("Count"); diff --git a/core/fpdfapi/parser/cpdf_document.h b/core/fpdfapi/parser/cpdf_document.h index a40993da17..81860a926d 100644 --- a/core/fpdfapi/parser/cpdf_document.h +++ b/core/fpdfapi/parser/cpdf_document.h @@ -170,8 +170,8 @@ class CPDF_Document : public Observable<CPDF_Document>, std::vector<std::pair<CPDF_Dictionary*, size_t>> m_pTreeTraversal; // Index of the next page that will be traversed from the page tree. - int m_iNextPageToTraverse; - bool m_bReachedMaxPageLevel; + int m_iNextPageToTraverse = 0; + bool m_bReachedMaxPageLevel = false; uint32_t m_ParsedPageCount = 0; std::unique_ptr<CPDF_DocPageData> m_pDocPage; std::unique_ptr<CPDF_DocRenderData> m_pDocRender; |