Index: fpdfsdk/fpdf_transformpage.cpp |
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp |
index 204e49b6950ee0593be09821052fd199ef04ed8e..68007d3ca53430e39a5199bfc44d71d9acee65fd 100644 |
--- a/fpdfsdk/fpdf_transformpage.cpp |
+++ b/fpdfsdk/fpdf_transformpage.cpp |
@@ -144,7 +144,7 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, |
pContentArray = pArray; |
CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum()); |
pContentArray->InsertAt(0, pRef); |
- pContentArray->AddReference(pDoc, pEndStream); |
+ pContentArray->AddReference(pDoc, pEndStream->GetObjNum()); |
} else if (CPDF_Reference* pReference = ToReference(pContentObj)) { |
CPDF_Object* pDirectObj = pReference->GetDirect(); |
if (pDirectObj) { |
@@ -153,12 +153,12 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page, |
pContentArray = pObjArray; |
CPDF_Reference* pRef = new CPDF_Reference(pDoc, pStream->GetObjNum()); |
pContentArray->InsertAt(0, pRef); |
- pContentArray->AddReference(pDoc, pEndStream); |
+ pContentArray->AddReference(pDoc, pEndStream->GetObjNum()); |
} else if (pDirectObj->IsStream()) { |
pContentArray = new CPDF_Array(); |
pContentArray->AddReference(pDoc, pStream->GetObjNum()); |
pContentArray->AddReference(pDoc, pDirectObj->GetObjNum()); |
- pContentArray->AddReference(pDoc, pEndStream); |
+ pContentArray->AddReference(pDoc, pEndStream->GetObjNum()); |
pPageDic->SetReferenceFor("Contents", pDoc, |
pDoc->AddIndirectObject(pContentArray)); |
} |
@@ -306,6 +306,7 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page, |
CPDF_Document* pDoc = pPage->m_pDocument; |
if (!pDoc) |
return; |
+ |
pDoc->AddIndirectObject(pStream); |
CPDF_Array* pContentArray = nullptr; |