summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_HtrdProc.cpp
diff options
context:
space:
mode:
authortsepez <tsepez@chromium.org>2016-12-14 05:57:10 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-14 05:57:10 -0800
commita9caab94c1f16929e5acf2676117224617d80f53 (patch)
treed71ff9a82fae6e6080deb76375f43056127b3ee2 /core/fxcodec/jbig2/JBig2_HtrdProc.cpp
parent992ecf7c189e5cabf43e5ad862511cf63d030966 (diff)
downloadpdfium-a9caab94c1f16929e5acf2676117224617d80f53.tar.xz
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
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_HtrdProc.cpp')
-rw-r--r--core/fxcodec/jbig2/JBig2_HtrdProc.cpp3
1 files changed, 2 insertions, 1 deletions
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<CJBig2_Image> HTREG(new CJBig2_Image(HBW, HBH));
HTREG->fill(HDEFPIXEL);
if (HENABLESKIP == 1) {
- HSKIP.reset(new CJBig2_Image(HGW, HGH));
+ HSKIP = pdfium::MakeUnique<CJBig2_Image>(HGW, HGH);
for (mg = 0; mg < HGH; mg++) {
for (ng = 0; ng < HGW; ng++) {
x = (HGX + mg * HRY + ng * HRX) >> 8;