Index: fpdfsdk/fpdfsave.cpp |
diff --git a/fpdfsdk/fpdfsave.cpp b/fpdfsdk/fpdfsave.cpp |
index 307163d1afabaa813adf2d0c2616a75a975f5c23..e5938b25425b42c69dcb77ee98c90f1122a31fb7 100644 |
--- a/fpdfsdk/fpdfsave.cpp |
+++ b/fpdfsdk/fpdfsave.cpp |
@@ -185,10 +185,10 @@ bool SaveXFADocumentData(CPDFXFA_Document* pDocument, |
} else { |
CPDF_Stream* pData = new CPDF_Stream; |
pData->InitStreamFromFile(pDsfileWrite.get(), pDataDict); |
- pPDFDocument->AddIndirectObject(pData); |
+ uint32_t objnum = pPDFDocument->AddIndirectObject(pData); |
iLast = pArray->GetCount() - 2; |
pArray->InsertAt(iLast, new CPDF_String("datasets", FALSE)); |
- pArray->InsertAt(iLast + 1, pData, pPDFDocument); |
+ pArray->InsertAt(iLast + 1, new CPDF_Reference(pPDFDocument, objnum)); |
} |
fileList->push_back(std::move(pDsfileWrite)); |
} |
@@ -206,10 +206,10 @@ bool SaveXFADocumentData(CPDFXFA_Document* pDocument, |
} else { |
CPDF_Stream* pData = new CPDF_Stream; |
pData->InitStreamFromFile(pfileWrite.get(), pDataDict); |
- pPDFDocument->AddIndirectObject(pData); |
+ uint32_t objnum = pPDFDocument->AddIndirectObject(pData); |
iLast = pArray->GetCount() - 2; |
pArray->InsertAt(iLast, new CPDF_String("form", FALSE)); |
- pArray->InsertAt(iLast + 1, pData, pPDFDocument); |
+ pArray->InsertAt(iLast + 1, new CPDF_Reference(pPDFDocument, objnum)); |
} |
fileList->push_back(std::move(pfileWrite)); |
} |