In the loop at line 219
for (auto& obj : GetObjects())
{
PdfReference ref(static_cast<uint32_t>(obj->GetIndirectReference().ObjectNumber() + difference), obj->GetIndirectReference().GenerationNumber());
auto newObj = new PdfObject(PdfDictionary());
newObj->setDirty();
newObj->SetIndirectReference(ref);
m_Objects.PushObject(newObj);
*newObj = *obj;
PoDoFo::LogMessage(PdfLogSeverity::Information, "Fixing references in {} {} R by {}",
newObj->GetIndirectReference().ObjectNumber(), newObj->GetIndirectReference().GenerationNumber(), difference);
fixObjectReferences(*newObj, difference);
}
You are looping over m_Objects while adding objects to it in the body of the loop. I can never remember all the semantics of C++ iterator invalidation, but that seems unlikely to be correct. And in practice i have observed that calling that function hangs in that loop, looping till out of memory.
In the loop at line 219
You are looping over m_Objects while adding objects to it in the body of the loop. I can never remember all the semantics of C++ iterator invalidation, but that seems unlikely to be correct. And in practice i have observed that calling that function hangs in that loop, looping till out of memory.