summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_transformpage.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdf_transformpage.cpp')
-rw-r--r--fpdfsdk/fpdf_transformpage.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/fpdfsdk/fpdf_transformpage.cpp b/fpdfsdk/fpdf_transformpage.cpp
index b1e8da06b9..13d9756bd8 100644
--- a/fpdfsdk/fpdf_transformpage.cpp
+++ b/fpdfsdk/fpdf_transformpage.cpp
@@ -128,13 +128,14 @@ DLLEXPORT FPDF_BOOL STDCALL FPDFPage_TransFormWithClip(FPDF_PAGE page,
if (!pDoc)
return false;
- CPDF_Dictionary* pDic = new CPDF_Dictionary(pDoc->GetByteStringPool());
- CPDF_Stream* pStream = pDoc->NewIndirect<CPDF_Stream>(nullptr, 0, pDic);
+ CPDF_Stream* pStream = pDoc->NewIndirect<CPDF_Stream>(
+ nullptr, 0,
+ pdfium::MakeUnique<CPDF_Dictionary>(pDoc->GetByteStringPool()));
pStream->SetData(textBuf.GetBuffer(), textBuf.GetSize());
- pDic = new CPDF_Dictionary(pDoc->GetByteStringPool());
-
- CPDF_Stream* pEndStream = pDoc->NewIndirect<CPDF_Stream>(nullptr, 0, pDic);
+ CPDF_Stream* pEndStream = pDoc->NewIndirect<CPDF_Stream>(
+ nullptr, 0,
+ pdfium::MakeUnique<CPDF_Dictionary>(pDoc->GetByteStringPool()));
pEndStream->SetData((const uint8_t*)" Q", 2);
CPDF_Array* pContentArray = nullptr;
@@ -302,8 +303,9 @@ DLLEXPORT void STDCALL FPDFPage_InsertClipPath(FPDF_PAGE page,
if (!pDoc)
return;
- CPDF_Dictionary* pDic = new CPDF_Dictionary(pDoc->GetByteStringPool());
- CPDF_Stream* pStream = pDoc->NewIndirect<CPDF_Stream>(nullptr, 0, pDic);
+ CPDF_Stream* pStream = pDoc->NewIndirect<CPDF_Stream>(
+ nullptr, 0,
+ pdfium::MakeUnique<CPDF_Dictionary>(pDoc->GetByteStringPool()));
pStream->SetData(strClip.GetBuffer(), strClip.GetSize());
CPDF_Array* pArray = ToArray(pContentObj);