diff options
author | Nicolas Pena <npm@chromium.org> | 2017-07-14 10:00:21 -0400 |
---|---|---|
committer | Chromium commit bot <commit-bot@chromium.org> | 2017-07-14 14:18:45 +0000 |
commit | b6db208773e94b9d25f7dbd740859adbb8a60fdf (patch) | |
tree | 8f0426521a18b70303cea0fcccd8f29e3eeead24 /core/fxcodec/jbig2/JBig2_PddProc.cpp | |
parent | 2b918c8d05c922287efbc8858f029026cee31442 (diff) | |
download | pdfium-b6db208773e94b9d25f7dbd740859adbb8a60fdf.tar.xz |
More unique_ptrs in JBIG2 code part 2
This CL makes HDPATS in CJBig2_PatternDict be a vector of unique_ptr.
Change-Id: Ib23aed6323d4a988b2eedc4bfe95f2098d32c188
Reviewed-on: https://pdfium-review.googlesource.com/7871
Commit-Queue: Nicolás Peña <npm@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_PddProc.cpp')
-rw-r--r-- | core/fxcodec/jbig2/JBig2_PddProc.cpp | 10 |
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; |