summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_TrdProc.cpp
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2018-08-22 17:34:42 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-08-22 17:34:42 +0000
commitdc7e7fa32798770243289827c9db2607061fb2a7 (patch)
tree49b072a5cde02f73186f83a3bc6c669506dcdec1 /core/fxcodec/jbig2/JBig2_TrdProc.cpp
parent962c1bc7e550b9466d802b0b94322693611fa30b (diff)
downloadpdfium-dc7e7fa32798770243289827c9db2607061fb2a7.tar.xz
Use UnownedPtr<> in JBig2_TrdProc, part 2.
Re-order some locals to obey strict lifetime constraint. Pack a little tighter. Change-Id: Iae011d21b934fac865cf10ac20c046c8917d3a98 Reviewed-on: https://pdfium-review.googlesource.com/40915 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Tom Sepez <tsepez@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_TrdProc.cpp')
-rw-r--r--core/fxcodec/jbig2/JBig2_TrdProc.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/core/fxcodec/jbig2/JBig2_TrdProc.cpp b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
index 4f082f376f..7aa5989972 100644
--- a/core/fxcodec/jbig2/JBig2_TrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
@@ -57,7 +57,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_TRDProc::DecodeHuffman(
SBREG->Fill(SBDEFPIXEL);
int32_t INITIAL_STRIPT;
auto pHuffmanDecoder = pdfium::MakeUnique<CJBig2_HuffmanDecoder>(pStream);
- if (pHuffmanDecoder->DecodeAValue(SBHUFFDT, &INITIAL_STRIPT) != 0)
+ if (pHuffmanDecoder->DecodeAValue(SBHUFFDT.Get(), &INITIAL_STRIPT) != 0)
return nullptr;
FX_SAFE_INT32 STRIPT = INITIAL_STRIPT;
@@ -67,7 +67,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_TRDProc::DecodeHuffman(
uint32_t NINSTANCES = 0;
while (NINSTANCES < SBNUMINSTANCES) {
int32_t INITIAL_DT;
- if (pHuffmanDecoder->DecodeAValue(SBHUFFDT, &INITIAL_DT) != 0)
+ if (pHuffmanDecoder->DecodeAValue(SBHUFFDT.Get(), &INITIAL_DT) != 0)
return nullptr;
FX_SAFE_INT32 DT = INITIAL_DT;
@@ -78,7 +78,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_TRDProc::DecodeHuffman(
for (;;) {
if (bFirst) {
int32_t DFS;
- if (pHuffmanDecoder->DecodeAValue(SBHUFFFS, &DFS) != 0)
+ if (pHuffmanDecoder->DecodeAValue(SBHUFFFS.Get(), &DFS) != 0)
return nullptr;
FIRSTS += DFS;
@@ -86,7 +86,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_TRDProc::DecodeHuffman(
bFirst = false;
} else {
int32_t IDS;
- int32_t nVal = pHuffmanDecoder->DecodeAValue(SBHUFFDS, &IDS);
+ int32_t nVal = pHuffmanDecoder->DecodeAValue(SBHUFFDS.Get(), &IDS);
if (nVal == JBIG2_OOB)
break;
@@ -147,11 +147,12 @@ std::unique_ptr<CJBig2_Image> CJBig2_TRDProc::DecodeHuffman(
int32_t RDXI;
int32_t RDYI;
int32_t HUFFRSIZE;
- if ((pHuffmanDecoder->DecodeAValue(SBHUFFRDW, &RDWI) != 0) ||
- (pHuffmanDecoder->DecodeAValue(SBHUFFRDH, &RDHI) != 0) ||
- (pHuffmanDecoder->DecodeAValue(SBHUFFRDX, &RDXI) != 0) ||
- (pHuffmanDecoder->DecodeAValue(SBHUFFRDY, &RDYI) != 0) ||
- (pHuffmanDecoder->DecodeAValue(SBHUFFRSIZE, &HUFFRSIZE) != 0)) {
+ if ((pHuffmanDecoder->DecodeAValue(SBHUFFRDW.Get(), &RDWI) != 0) ||
+ (pHuffmanDecoder->DecodeAValue(SBHUFFRDH.Get(), &RDHI) != 0) ||
+ (pHuffmanDecoder->DecodeAValue(SBHUFFRDX.Get(), &RDXI) != 0) ||
+ (pHuffmanDecoder->DecodeAValue(SBHUFFRDY.Get(), &RDYI) != 0) ||
+ (pHuffmanDecoder->DecodeAValue(SBHUFFRSIZE.Get(), &HUFFRSIZE) !=
+ 0)) {
return nullptr;
}
pStream->alignByte();