Index: core/fpdfdoc/cpdf_interform.cpp |
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp |
index 2a02e890c39845d87a30d451c73a9c21f2e09488..64d15a0d8896f2ae6270f49b38bbd7ac229dc6e9 100644 |
--- a/core/fpdfdoc/cpdf_interform.cpp |
+++ b/core/fpdfdoc/cpdf_interform.cpp |
@@ -59,9 +59,10 @@ void InitDict(CPDF_Dictionary*& pFormDict, CPDF_Document* pDocument) { |
return; |
if (!pFormDict) { |
- pFormDict = new CPDF_Dictionary(pDocument->GetByteStringPool()); |
- pDocument->GetRoot()->SetReferenceFor( |
- "AcroForm", pDocument, pDocument->AddIndirectObject(pFormDict)); |
+ pFormDict = |
+ pDocument->NewIndirect<CPDF_Dictionary>(pDocument->GetByteStringPool()); |
+ pDocument->GetRoot()->SetReferenceFor("AcroForm", pDocument, |
+ pFormDict->GetObjNum()); |
} |
CFX_ByteString csDA; |