From a9caab94c1f16929e5acf2676117224617d80f53 Mon Sep 17 00:00:00 2001 From: tsepez Date: Wed, 14 Dec 2016 05:57:10 -0800 Subject: Avoid the ptr.reset(new XXX()) anti-pattern Be suspicious of |new|. This removes some of the easy cases. Review-Url: https://codereview.chromium.org/2571913002 --- core/fxcodec/jbig2/JBig2_HtrdProc.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'core/fxcodec/jbig2/JBig2_HtrdProc.cpp') diff --git a/core/fxcodec/jbig2/JBig2_HtrdProc.cpp b/core/fxcodec/jbig2/JBig2_HtrdProc.cpp index f3391b32ff..121bf1d6df 100644 --- a/core/fxcodec/jbig2/JBig2_HtrdProc.cpp +++ b/core/fxcodec/jbig2/JBig2_HtrdProc.cpp @@ -10,6 +10,7 @@ #include "core/fxcodec/jbig2/JBig2_GsidProc.h" #include "core/fxcrt/fx_basic.h" +#include "third_party/base/ptr_util.h" CJBig2_Image* CJBig2_HTRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder, JBig2ArithCtx* gbContext, @@ -22,7 +23,7 @@ CJBig2_Image* CJBig2_HTRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder, std::unique_ptr HTREG(new CJBig2_Image(HBW, HBH)); HTREG->fill(HDEFPIXEL); if (HENABLESKIP == 1) { - HSKIP.reset(new CJBig2_Image(HGW, HGH)); + HSKIP = pdfium::MakeUnique(HGW, HGH); for (mg = 0; mg < HGH; mg++) { for (ng = 0; ng < HGW; ng++) { x = (HGX + mg * HRY + ng * HRX) >> 8; -- cgit v1.2.3