summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_TrdProc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_TrdProc.cpp')
-rw-r--r--core/fxcodec/jbig2/JBig2_TrdProc.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/core/fxcodec/jbig2/JBig2_TrdProc.cpp b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
index 84042dbd8c..cf58d9c3c6 100644
--- a/core/fxcodec/jbig2/JBig2_TrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
@@ -16,9 +16,8 @@
CJBig2_Image* CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream* pStream,
JBig2ArithCtx* grContext) {
- std::unique_ptr<CJBig2_HuffmanDecoder> pHuffmanDecoder(
- new CJBig2_HuffmanDecoder(pStream));
- std::unique_ptr<CJBig2_Image> SBREG(new CJBig2_Image(SBW, SBH));
+ auto pHuffmanDecoder = pdfium::MakeUnique<CJBig2_HuffmanDecoder>(pStream);
+ auto SBREG = pdfium::MakeUnique<CJBig2_Image>(SBW, SBH);
SBREG->fill(SBDEFPIXEL);
int32_t STRIPT;
if (pHuffmanDecoder->decodeAValue(SBHUFFDT, &STRIPT) != 0)
@@ -120,7 +119,7 @@ CJBig2_Image* CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream* pStream,
if ((int)(WOI + RDWI) < 0 || (int)(HOI + RDHI) < 0)
return nullptr;
- std::unique_ptr<CJBig2_GRRDProc> pGRRD(new CJBig2_GRRDProc());
+ auto pGRRD = pdfium::MakeUnique<CJBig2_GRRDProc>();
pGRRD->GRW = WOI + RDWI;
pGRRD->GRH = HOI + RDHI;
pGRRD->GRTEMPLATE = SBRTEMPLATE;
@@ -134,8 +133,7 @@ CJBig2_Image* CJBig2_TRDProc::decode_Huffman(CJBig2_BitStream* pStream,
pGRRD->GRAT[3] = SBRAT[3];
{
- std::unique_ptr<CJBig2_ArithDecoder> pArithDecoder(
- new CJBig2_ArithDecoder(pStream));
+ auto pArithDecoder = pdfium::MakeUnique<CJBig2_ArithDecoder>(pStream);
IBI = pGRRD->decode(pArithDecoder.get(), grContext);
if (!IBI)
return nullptr;
@@ -264,7 +262,7 @@ CJBig2_Image* CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
pIARDY = IARDY.get();
pIAID = IAID.get();
}
- std::unique_ptr<CJBig2_Image> SBREG(new CJBig2_Image(SBW, SBH));
+ auto SBREG = pdfium::MakeUnique<CJBig2_Image>(SBW, SBH);
SBREG->fill(SBDEFPIXEL);
int32_t STRIPT;
if (!pIADT->decode(pArithDecoder, &STRIPT))
@@ -335,7 +333,7 @@ CJBig2_Image* CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
if ((int)(WOI + RDWI) < 0 || (int)(HOI + RDHI) < 0)
return nullptr;
- std::unique_ptr<CJBig2_GRRDProc> pGRRD(new CJBig2_GRRDProc());
+ auto pGRRD = pdfium::MakeUnique<CJBig2_GRRDProc>();
pGRRD->GRW = WOI + RDWI;
pGRRD->GRH = HOI + RDHI;
pGRRD->GRTEMPLATE = SBRTEMPLATE;