diff options
Diffstat (limited to 'core/fpdfapi/parser/cpdf_data_avail.cpp')
-rw-r--r-- | core/fpdfapi/parser/cpdf_data_avail.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp index eadbf1e828..c4ed95e17f 100644 --- a/core/fpdfapi/parser/cpdf_data_avail.cpp +++ b/core/fpdfapi/parser/cpdf_data_avail.cpp @@ -1763,13 +1763,11 @@ CPDF_Dictionary* CPDF_DataAvail::GetPage(int index) { // We should say to the document, which object is the page. m_pDocument->SetPageObjNum(index, dwObjNum); // Page object already can be parsed in document. - CPDF_Object* pPageDict = m_pDocument->GetIndirectObject(dwObjNum); - if (!pPageDict) { + if (!m_pDocument->GetIndirectObject(dwObjNum)) { m_syntaxParser.InitParser(m_pFileRead, (uint32_t)szPageStartPos); - pPageDict = ParseIndirectObjectAt(0, dwObjNum, m_pDocument); - if (pPageDict) { - m_pDocument->ReplaceIndirectObjectIfHigherGeneration(dwObjNum, pPageDict); - } + m_pDocument->ReplaceIndirectObjectIfHigherGeneration( + dwObjNum, pdfium::WrapUnique<CPDF_Object>( + ParseIndirectObjectAt(0, dwObjNum, m_pDocument))); } return m_pDocument->GetPage(index); } |