From 0bb1333a9eff1190ddd68f34c71d6a779c69dfef Mon Sep 17 00:00:00 2001 From: Dan Sinclair Date: Thu, 30 Mar 2017 16:12:02 -0400 Subject: Add some calls to MakeUnique This CL replaces some new's with pdfium::MakeUnique. Change-Id: I50faf3ed55e7730b094c14a7989a9dd51cf33cbb Reviewed-on: https://pdfium-review.googlesource.com/3430 Commit-Queue: dsinclair Reviewed-by: Tom Sepez --- core/fxcodec/jbig2/JBig2_GrrdProc.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'core/fxcodec/jbig2/JBig2_GrrdProc.cpp') diff --git a/core/fxcodec/jbig2/JBig2_GrrdProc.cpp b/core/fxcodec/jbig2/JBig2_GrrdProc.cpp index 669fed68e9..936b851d37 100644 --- a/core/fxcodec/jbig2/JBig2_GrrdProc.cpp +++ b/core/fxcodec/jbig2/JBig2_GrrdProc.cpp @@ -11,6 +11,7 @@ #include "core/fxcodec/jbig2/JBig2_ArithDecoder.h" #include "core/fxcodec/jbig2/JBig2_BitStream.h" #include "core/fxcodec/jbig2/JBig2_Image.h" +#include "third_party/base/ptr_util.h" CJBig2_Image* CJBig2_GRRDProc::decode(CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* grContext) { @@ -35,7 +36,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template0_unopt( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* grContext) { int LTP = 0; - std::unique_ptr GRREG(new CJBig2_Image(GRW, GRH)); + auto GRREG = pdfium::MakeUnique(GRW, GRH); GRREG->fill(0); for (uint32_t h = 0; h < GRH; h++) { if (TPGRON) @@ -155,7 +156,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template0_opt( int32_t iGRW = static_cast(GRW); int32_t iGRH = static_cast(GRH); - std::unique_ptr GRREG(new CJBig2_Image(iGRW, iGRH)); + auto GRREG = pdfium::MakeUnique(iGRW, iGRH); if (!GRREG->m_pData) return nullptr; @@ -283,7 +284,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template1_unopt( CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* grContext) { int LTP = 0; - std::unique_ptr GRREG(new CJBig2_Image(GRW, GRH)); + auto GRREG = pdfium::MakeUnique(GRW, GRH); GRREG->fill(0); for (uint32_t h = 0; h < GRH; h++) { if (TPGRON) @@ -389,7 +390,7 @@ CJBig2_Image* CJBig2_GRRDProc::decode_Template1_opt( int32_t iGRW = static_cast(GRW); int32_t iGRH = static_cast(GRH); - std::unique_ptr GRREG(new CJBig2_Image(iGRW, iGRH)); + auto GRREG = pdfium::MakeUnique(iGRW, iGRH); if (!GRREG->m_pData) return nullptr; -- cgit v1.2.3