summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_GrrdProc.cpp
diff options
context:
space:
mode:
authorDan Sinclair <dsinclair@chromium.org>2017-03-30 16:12:02 -0400
committerChromium commit bot <commit-bot@chromium.org>2017-03-30 20:26:02 +0000
commit0bb1333a9eff1190ddd68f34c71d6a779c69dfef (patch)
tree5a46946c4852f147309e2b1389e6f42d6553abf7 /core/fxcodec/jbig2/JBig2_GrrdProc.cpp
parent908c848202ef137e98d96f82a4eadfae551403b7 (diff)
downloadpdfium-0bb1333a9eff1190ddd68f34c71d6a779c69dfef.tar.xz
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 <dsinclair@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_GrrdProc.cpp')
-rw-r--r--core/fxcodec/jbig2/JBig2_GrrdProc.cpp9
1 files changed, 5 insertions, 4 deletions
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<CJBig2_Image> GRREG(new CJBig2_Image(GRW, GRH));
+ auto GRREG = pdfium::MakeUnique<CJBig2_Image>(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<int32_t>(GRW);
int32_t iGRH = static_cast<int32_t>(GRH);
- std::unique_ptr<CJBig2_Image> GRREG(new CJBig2_Image(iGRW, iGRH));
+ auto GRREG = pdfium::MakeUnique<CJBig2_Image>(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<CJBig2_Image> GRREG(new CJBig2_Image(GRW, GRH));
+ auto GRREG = pdfium::MakeUnique<CJBig2_Image>(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<int32_t>(GRW);
int32_t iGRH = static_cast<int32_t>(GRH);
- std::unique_ptr<CJBig2_Image> GRREG(new CJBig2_Image(iGRW, iGRH));
+ auto GRREG = pdfium::MakeUnique<CJBig2_Image>(iGRW, iGRH);
if (!GRREG->m_pData)
return nullptr;