Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2934)

Unified Diff: core/src/fxcodec/jbig2/JBig2_TrdProc.cpp

Issue 1359013003: Cleanup JBig2_ArithIntDecoder. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: address comments Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: core/src/fxcodec/jbig2/JBig2_TrdProc.cpp
diff --git a/core/src/fxcodec/jbig2/JBig2_TrdProc.cpp b/core/src/fxcodec/jbig2/JBig2_TrdProc.cpp
index afa3dba920fc4d3a07db759dc7ba4f7bc65f0105..9b457adf963a8693801998341312913af799a839 100644
--- a/core/src/fxcodec/jbig2/JBig2_TrdProc.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_TrdProc.cpp
@@ -262,7 +262,7 @@ CJBig2_Image* CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
}
nonstd::unique_ptr<CJBig2_Image> SBREG(new CJBig2_Image(SBW, SBH));
SBREG->fill(SBDEFPIXEL);
- if (IADT->decode(pArithDecoder, &STRIPT) == -1) {
+ if (!IADT->decode(pArithDecoder, &STRIPT)) {
goto failed;
}
STRIPT *= SBSTRIPS;
@@ -270,7 +270,7 @@ CJBig2_Image* CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
FIRSTS = 0;
NINSTANCES = 0;
while (NINSTANCES < SBNUMINSTANCES) {
- if (IADT->decode(pArithDecoder, &DT) == -1) {
+ if (!IADT->decode(pArithDecoder, &DT)) {
goto failed;
}
DT *= SBSTRIPS;
@@ -278,7 +278,7 @@ CJBig2_Image* CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
bFirst = TRUE;
for (;;) {
if (bFirst) {
- if (IAFS->decode(pArithDecoder, &DFS) == -1) {
+ if (!IAFS->decode(pArithDecoder, &DFS)) {
goto failed;
}
FIRSTS = FIRSTS + DFS;
@@ -300,15 +300,13 @@ CJBig2_Image* CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
if (SBSTRIPS == 1) {
CURT = 0;
} else {
- if (IAIT->decode(pArithDecoder, &nVal) == -1) {
+ if (!IAIT->decode(pArithDecoder, &nVal)) {
goto failed;
}
CURT = nVal;
}
TI = STRIPT + CURT;
- if (IAID->decode(pArithDecoder, &nVal) == -1) {
- goto failed;
- }
+ IAID->decode(pArithDecoder, &nVal);
IDI = nVal;
if (IDI >= SBNUMSYMS) {
goto failed;
@@ -316,7 +314,7 @@ CJBig2_Image* CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
if (SBREFINE == 0) {
RI = 0;
} else {
- if (IARI->decode(pArithDecoder, &RI) == -1) {
+ if (!IARI->decode(pArithDecoder, &RI)) {
goto failed;
}
}
@@ -326,10 +324,10 @@ CJBig2_Image* CJBig2_TRDProc::decode_Arith(CJBig2_ArithDecoder* pArithDecoder,
if (RI == 0) {
IBI = SBSYMS[IDI];
} else {
- if ((IARDW->decode(pArithDecoder, &RDWI) == -1) ||
- (IARDH->decode(pArithDecoder, &RDHI) == -1) ||
- (IARDX->decode(pArithDecoder, &RDXI) == -1) ||
- (IARDY->decode(pArithDecoder, &RDYI) == -1)) {
+ if (!IARDW->decode(pArithDecoder, &RDWI) ||
+ !IARDH->decode(pArithDecoder, &RDHI) ||
+ !IARDX->decode(pArithDecoder, &RDXI) ||
+ !IARDY->decode(pArithDecoder, &RDYI)) {
goto failed;
}
IBOI = SBSYMS[IDI];
« core/src/fxcodec/jbig2/JBig2_SddProc.cpp ('K') | « core/src/fxcodec/jbig2/JBig2_SddProc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698