Index: core/fxcodec/jbig2/JBig2_SddProc.cpp |
diff --git a/core/fxcodec/jbig2/JBig2_SddProc.cpp b/core/fxcodec/jbig2/JBig2_SddProc.cpp |
index 7e9ace204696c4db7228dc3500b1b8a1aaf925e7..d27ff680d5205c38e86cd2c5a51ba07140f7957b 100644 |
--- a/core/fxcodec/jbig2/JBig2_SddProc.cpp |
+++ b/core/fxcodec/jbig2/JBig2_SddProc.cpp |
@@ -18,6 +18,7 @@ |
#include "core/fxcodec/jbig2/JBig2_SymbolDict.h" |
#include "core/fxcodec/jbig2/JBig2_TrdProc.h" |
#include "core/fxcrt/fx_basic.h" |
+#include "third_party/base/ptr_util.h" |
CJBig2_SymbolDict* CJBig2_SDDProc::decode_Arith( |
CJBig2_ArithDecoder* pArithDecoder, |
@@ -59,7 +60,7 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Arith( |
while ((uint32_t)(1 << nTmp) < (SDNUMINSYMS + SDNUMNEWSYMS)) { |
nTmp++; |
} |
- IAID.reset(new CJBig2_ArithIaidDecoder((uint8_t)nTmp)); |
+ IAID = pdfium::MakeUnique<CJBig2_ArithIaidDecoder>((uint8_t)nTmp); |
SDNEWSYMS = FX_Alloc(CJBig2_Image*, SDNUMNEWSYMS); |
FXSYS_memset(SDNEWSYMS, 0, SDNUMNEWSYMS * sizeof(CJBig2_Image*)); |
@@ -258,7 +259,7 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Arith( |
goto failed; |
} |
- pDict.reset(new CJBig2_SymbolDict); |
+ pDict = pdfium::MakeUnique<CJBig2_SymbolDict>(); |
I = J = 0; |
for (I = 0; I < SDNUMINSYMS + SDNUMNEWSYMS; I++) { |
if (EXFLAGS[I] && J < SDNUMEXSYMS) { |
@@ -562,8 +563,8 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Huffman( |
} |
EXINDEX = 0; |
CUREXFLAG = 0; |
- pTable.reset(new CJBig2_HuffmanTable(HuffmanTable_B1, HuffmanTable_B1_Size, |
- HuffmanTable_HTOOB_B1)); |
+ pTable = pdfium::MakeUnique<CJBig2_HuffmanTable>( |
+ HuffmanTable_B1, HuffmanTable_B1_Size, HuffmanTable_HTOOB_B1); |
EXFLAGS = FX_Alloc(bool, SDNUMINSYMS + SDNUMNEWSYMS); |
num_ex_syms = 0; |
while (EXINDEX < SDNUMINSYMS + SDNUMNEWSYMS) { |