Index: core/fpdfapi/parser/cpdf_data_avail.cpp |
diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp |
index eadbf1e8282c144c0e5f72c4f3783e18668bd033..c4ed95e17f27d344afdede77d2c756d91a43aa35 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); |
} |