summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_SddProc.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-21 21:11:31 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-21 21:11:31 +0000
commit43927ad2f498a388b0fd4840b861a8bf01c790b1 (patch)
tree2910fb9b4a1ce4f0e4e2044b32208b93c3d206f2 /core/fxcodec/jbig2/JBig2_SddProc.cpp
parent18125c7d2a73fad9f0b545efc8604025088167e3 (diff)
downloadpdfium-43927ad2f498a388b0fd4840b861a8bf01c790b1.tar.xz
Use UnownedPtr<> in JBIG2_SDDProc.
Pack a little tighter while at it. Change-Id: If7cbb324ebf828a4bb60eb364fc3e0f31625e57f Reviewed-on: https://pdfium-review.googlesource.com/40913 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_SddProc.cpp')
-rw-r--r--core/fxcodec/jbig2/JBig2_SddProc.cpp17
1 files changed, 11 insertions, 6 deletions
diff --git a/core/fxcodec/jbig2/JBig2_SddProc.cpp b/core/fxcodec/jbig2/JBig2_SddProc.cpp
index 29c604f1c7..7bdcf5c5f9 100644
--- a/core/fxcodec/jbig2/JBig2_SddProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_SddProc.cpp
@@ -22,6 +22,10 @@
#include "core/fxcodec/jbig2/JBig2_TrdProc.h"
#include "third_party/base/ptr_util.h"
+CJBig2_SDDProc::CJBig2_SDDProc() = default;
+
+CJBig2_SDDProc::~CJBig2_SDDProc() = default;
+
std::unique_ptr<CJBig2_SymbolDict> CJBig2_SDDProc::DecodeArith(
CJBig2_ArithDecoder* pArithDecoder,
std::vector<JBig2ArithCtx>* gbContext,
@@ -289,7 +293,7 @@ std::unique_ptr<CJBig2_SymbolDict> CJBig2_SDDProc::DecodeHuffman(
NSYMSDECODED = 0;
std::unique_ptr<CJBig2_Image> BS;
while (NSYMSDECODED < SDNUMNEWSYMS) {
- if (pHuffmanDecoder->DecodeAValue(SDHUFFDH, &HCDH) != 0)
+ if (pHuffmanDecoder->DecodeAValue(SDHUFFDH.Get(), &HCDH) != 0)
return nullptr;
HCHEIGHT = HCHEIGHT + HCDH;
@@ -300,7 +304,7 @@ std::unique_ptr<CJBig2_SymbolDict> CJBig2_SDDProc::DecodeHuffman(
TOTWIDTH = 0;
HCFIRSTSYM = NSYMSDECODED;
for (;;) {
- nVal = pHuffmanDecoder->DecodeAValue(SDHUFFDW, &DW);
+ nVal = pHuffmanDecoder->DecodeAValue(SDHUFFDW.Get(), &DW);
if (nVal == JBIG2_OOB)
break;
if (nVal != 0)
@@ -319,8 +323,8 @@ std::unique_ptr<CJBig2_SymbolDict> CJBig2_SDDProc::DecodeHuffman(
}
TOTWIDTH = TOTWIDTH + SYMWIDTH;
if (SDREFAGG == 1) {
- if (pHuffmanDecoder->DecodeAValue(SDHUFFAGGINST, (int*)&REFAGGNINST) !=
- 0) {
+ if (pHuffmanDecoder->DecodeAValue(SDHUFFAGGINST.Get(),
+ (int*)&REFAGGNINST) != 0) {
return nullptr;
}
BS = nullptr;
@@ -440,9 +444,10 @@ std::unique_ptr<CJBig2_SymbolDict> CJBig2_SDDProc::DecodeHuffman(
NSYMSDECODED = NSYMSDECODED + 1;
}
if (SDREFAGG == 0) {
- if (pHuffmanDecoder->DecodeAValue(SDHUFFBMSIZE, (int32_t*)&BMSIZE) != 0)
+ if (pHuffmanDecoder->DecodeAValue(SDHUFFBMSIZE.Get(),
+ (int32_t*)&BMSIZE) != 0) {
return nullptr;
-
+ }
pStream->alignByte();
std::unique_ptr<CJBig2_Image> BHC;
if (BMSIZE == 0) {