summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser
diff options
context:
space:
mode:
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r--core/fpdfapi/parser/cpdf_data_avail.cpp8
-rw-r--r--core/fpdfapi/parser/cpdf_document.cpp3
2 files changed, 5 insertions, 6 deletions
diff --git a/core/fpdfapi/parser/cpdf_data_avail.cpp b/core/fpdfapi/parser/cpdf_data_avail.cpp
index 41a3f0dae2..3195821279 100644
--- a/core/fpdfapi/parser/cpdf_data_avail.cpp
+++ b/core/fpdfapi/parser/cpdf_data_avail.cpp
@@ -645,10 +645,10 @@ bool CPDF_DataAvail::CheckHintTables(DownloadHints* pHints) {
m_syntaxParser.InitParser(m_pFileRead, m_dwHeaderOffset);
- std::unique_ptr<CPDF_HintTables> pHintTables(
- new CPDF_HintTables(this, m_pLinearized.get()));
- std::unique_ptr<CPDF_Object> pHintStream(
- ParseIndirectObjectAt(szHintStart, 0));
+ auto pHintTables =
+ pdfium::MakeUnique<CPDF_HintTables>(this, m_pLinearized.get());
+ std::unique_ptr<CPDF_Object> pHintStream =
+ ParseIndirectObjectAt(szHintStart, 0);
CPDF_Stream* pStream = ToStream(pHintStream.get());
if (pStream && pHintTables->LoadHintStream(pStream))
m_pHintTables = std::move(pHintTables);
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp
index 48791262ea..73d3081a9f 100644
--- a/core/fpdfapi/parser/cpdf_document.cpp
+++ b/core/fpdfapi/parser/cpdf_document.cpp
@@ -887,8 +887,7 @@ CPDF_Font* CPDF_Document::AddFont(CFX_Font* pFont, int charset, bool bVert) {
CPDF_Dictionary* pBaseDict = NewIndirect<CPDF_Dictionary>();
pBaseDict->SetNewFor<CPDF_Name>("Type", "Font");
- std::unique_ptr<CFX_UnicodeEncoding> pEncoding(
- new CFX_UnicodeEncoding(pFont));
+ auto pEncoding = pdfium::MakeUnique<CFX_UnicodeEncoding>(pFont);
CPDF_Dictionary* pFontDict = pBaseDict;
if (!bCJK) {
auto pWidths = pdfium::MakeUnique<CPDF_Array>();