summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser/cpdf_dictionary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser/cpdf_dictionary.cpp')
-rw-r--r--core/fpdfapi/parser/cpdf_dictionary.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/fpdfapi/parser/cpdf_dictionary.cpp b/core/fpdfapi/parser/cpdf_dictionary.cpp
index 653ef45067..d4e4080d31 100644
--- a/core/fpdfapi/parser/cpdf_dictionary.cpp
+++ b/core/fpdfapi/parser/cpdf_dictionary.cpp
@@ -68,8 +68,9 @@ std::unique_ptr<CPDF_Object> CPDF_Dictionary::CloneNonCyclic(
auto pCopy = pdfium::MakeUnique<CPDF_Dictionary>(m_pPool);
for (const auto& it : *this) {
if (!pdfium::ContainsKey(*pVisited, it.second.get())) {
- pCopy->m_Map.insert(std::make_pair(
- it.first, it.second->CloneNonCyclic(bDirect, pVisited)));
+ std::set<const CPDF_Object*> visited(*pVisited);
+ if (auto obj = it.second->CloneNonCyclic(bDirect, &visited))
+ pCopy->m_Map.insert(std::make_pair(it.first, std::move(obj)));
}
}
return std::move(pCopy);