summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_PddProc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_PddProc.cpp')
-rw-r--r--core/fxcodec/jbig2/JBig2_PddProc.cpp10
1 files changed, 2 insertions, 8 deletions
diff --git a/core/fxcodec/jbig2/JBig2_PddProc.cpp b/core/fxcodec/jbig2/JBig2_PddProc.cpp
index 7a44dc7e39..e195d8f403 100644
--- a/core/fxcodec/jbig2/JBig2_PddProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_PddProc.cpp
@@ -19,10 +19,7 @@ std::unique_ptr<CJBig2_PatternDict> CJBig2_PDDProc::decode_Arith(
IFX_Pause* pPause) {
uint32_t GRAY;
std::unique_ptr<CJBig2_Image> BHDC;
- auto pDict = pdfium::MakeUnique<CJBig2_PatternDict>();
- pDict->NUMPATS = GRAYMAX + 1;
- pDict->HDPATS = FX_Alloc(CJBig2_Image*, pDict->NUMPATS);
- JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*) * pDict->NUMPATS);
+ auto pDict = pdfium::MakeUnique<CJBig2_PatternDict>(GRAYMAX + 1);
auto pGRD = pdfium::MakeUnique<CJBig2_GRDProc>();
pGRD->MMR = HDMMR;
@@ -60,10 +57,7 @@ std::unique_ptr<CJBig2_PatternDict> CJBig2_PDDProc::decode_MMR(
CJBig2_BitStream* pStream) {
uint32_t GRAY;
std::unique_ptr<CJBig2_Image> BHDC;
- auto pDict = pdfium::MakeUnique<CJBig2_PatternDict>();
- pDict->NUMPATS = GRAYMAX + 1;
- pDict->HDPATS = FX_Alloc(CJBig2_Image*, pDict->NUMPATS);
- JBIG2_memset(pDict->HDPATS, 0, sizeof(CJBig2_Image*) * pDict->NUMPATS);
+ auto pDict = pdfium::MakeUnique<CJBig2_PatternDict>(GRAYMAX + 1);
auto pGRD = pdfium::MakeUnique<CJBig2_GRDProc>();
pGRD->MMR = HDMMR;