Index: core/fpdfapi/parser/cpdf_parser.cpp |
diff --git a/core/fpdfapi/parser/cpdf_parser.cpp b/core/fpdfapi/parser/cpdf_parser.cpp |
index c43614f6286de49d4132014380db4d0ac3b319ec..6b49ad3641c22bdb203db0287a40327dccb12aff 100644 |
--- a/core/fpdfapi/parser/cpdf_parser.cpp |
+++ b/core/fpdfapi/parser/cpdf_parser.cpp |
@@ -802,16 +802,15 @@ bool CPDF_Parser::RebuildCrossRef() { |
auto it = pTrailer->begin(); |
while (it != pTrailer->end()) { |
const CFX_ByteString& key = it->first; |
- CPDF_Object* pElement = it->second; |
+ CPDF_Object* pElement = it->second.get(); |
++it; |
uint32_t dwObjNum = |
pElement ? pElement->GetObjNum() : 0; |
if (dwObjNum) { |
- m_pTrailer->SetReferenceFor(key, m_pDocument, |
- dwObjNum); |
+ m_pTrailer->SetNewFor<CPDF_Reference>( |
+ key, m_pDocument, dwObjNum); |
} else { |
- m_pTrailer->SetFor(key, |
- pElement->Clone().release()); |
+ m_pTrailer->SetFor(key, pElement->Clone()); |
} |
} |
} |
@@ -1075,7 +1074,7 @@ CPDF_Array* CPDF_Parser::GetIDArray() { |
if (CPDF_Reference* pRef = pID->AsReference()) { |
pID = ParseIndirectObject(nullptr, pRef->GetRefObjNum()).release(); |
- m_pTrailer->SetFor("ID", pID); |
+ m_pTrailer->SetFor("ID", pdfium::WrapUnique(pID)); |
} |
return ToArray(pID); |
} |