Index: core/fpdfapi/fpdf_parser/cpdf_parser.cpp |
diff --git a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp |
index b2f1a4be3f7c3323d1409d320f69850b20a59063..26adf7bb137eaf350de286d832569f856bd56235 100644 |
--- a/core/fpdfapi/fpdf_parser/cpdf_parser.cpp |
+++ b/core/fpdfapi/fpdf_parser/cpdf_parser.cpp |
@@ -267,7 +267,7 @@ CPDF_Parser::Error CPDF_Parser::SetEncryptHandler() { |
if (CPDF_Dictionary* pEncryptDict = pEncryptObj->AsDictionary()) { |
SetEncryptDictionary(pEncryptDict); |
} else if (CPDF_Reference* pRef = pEncryptObj->AsReference()) { |
- pEncryptObj = m_pDocument->GetIndirectObject(pRef->GetRefObjNum()); |
+ pEncryptObj = m_pDocument->GetOrParseIndirectObject(pRef->GetRefObjNum()); |
if (pEncryptObj) |
SetEncryptDictionary(pEncryptObj->GetDict()); |
} |
@@ -986,8 +986,10 @@ FX_BOOL CPDF_Parser::LoadCrossRefV5(FX_FILESIZE* pos, FX_BOOL bMainXRef) { |
pObject->Release(); |
return FALSE; |
} |
- if (!m_pDocument->InsertIndirectObject(pObject->m_ObjNum, pObject)) |
+ if (!m_pDocument->ReplaceIndirectObjectIfHigherGeneration(pObject->m_ObjNum, |
+ pObject)) { |
return FALSE; |
+ } |
} |
CPDF_Stream* pStream = pObject->AsStream(); |
@@ -1230,7 +1232,8 @@ CPDF_StreamAcc* CPDF_Parser::GetObjectStream(uint32_t objnum) { |
if (!m_pDocument) |
return nullptr; |
- const CPDF_Stream* pStream = ToStream(m_pDocument->GetIndirectObject(objnum)); |
+ const CPDF_Stream* pStream = |
+ ToStream(m_pDocument->GetOrParseIndirectObject(objnum)); |
if (!pStream) |
return nullptr; |