summaryrefslogtreecommitdiff
path: root/fpdfsdk/fpdf_flatten.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'fpdfsdk/fpdf_flatten.cpp')
-rw-r--r--fpdfsdk/fpdf_flatten.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/fpdfsdk/fpdf_flatten.cpp b/fpdfsdk/fpdf_flatten.cpp
index ccbb7b8765..e649bacf49 100644
--- a/fpdfsdk/fpdf_flatten.cpp
+++ b/fpdfsdk/fpdf_flatten.cpp
@@ -178,7 +178,8 @@ CFX_FloatRect CalculateRect(std::vector<CFX_FloatRect>* pRectArray) {
uint32_t NewIndirectContentsStream(const CFX_ByteString& key,
CPDF_Document* pDocument) {
CPDF_Stream* pNewContents = pDocument->NewIndirect<CPDF_Stream>(
- nullptr, 0, new CPDF_Dictionary(pDocument->GetByteStringPool()));
+ nullptr, 0,
+ pdfium::MakeUnique<CPDF_Dictionary>(pDocument->GetByteStringPool()));
CFX_ByteString sStream;
sStream.Format("q 1 0 0 1 0 0 cm /%s Do Q", key.c_str());
pNewContents->SetData(sStream.raw_str(), sStream.GetLength());
@@ -296,7 +297,8 @@ DLLEXPORT int STDCALL FPDFPage_Flatten(FPDF_PAGE page, int nFlag) {
pRes = pPageDict->SetNewFor<CPDF_Dictionary>("Resources");
CPDF_Stream* pNewXObject = pDocument->NewIndirect<CPDF_Stream>(
- nullptr, 0, new CPDF_Dictionary(pDocument->GetByteStringPool()));
+ nullptr, 0,
+ pdfium::MakeUnique<CPDF_Dictionary>(pDocument->GetByteStringPool()));
uint32_t dwObjNum = pNewXObject->GetObjNum();
CPDF_Dictionary* pPageXObject = pRes->GetDictFor("XObject");