summaryrefslogtreecommitdiff
path: root/core/src/fxcodec/jbig2/JBig2_SddProc.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-10-01 14:03:33 -0700
committerLei Zhang <thestig@chromium.org>2015-10-01 14:03:33 -0700
commit61d25619b1e7647b10689352039966a1394feae6 (patch)
tree9905fdfb8501a0d5861d9a6f06be59329e7be86d /core/src/fxcodec/jbig2/JBig2_SddProc.cpp
parent016a347171b8df1b5c45c342bdba66a4e3c94365 (diff)
downloadpdfium-61d25619b1e7647b10689352039966a1394feae6.tar.xz
Merge to XFA: Cleanup JBig2_ArithIntDecoder.
TBR=tsepez@chromium.org Review URL: https://codereview.chromium.org/1359013003 . (cherry picked from commit ce37d7347f1ab4c9fc1f48a137628da641bb4f14) Review URL: https://codereview.chromium.org/1386473002 .
Diffstat (limited to 'core/src/fxcodec/jbig2/JBig2_SddProc.cpp')
-rw-r--r--core/src/fxcodec/jbig2/JBig2_SddProc.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/core/src/fxcodec/jbig2/JBig2_SddProc.cpp b/core/src/fxcodec/jbig2/JBig2_SddProc.cpp
index ae5635b462..afce6eb330 100644
--- a/core/src/fxcodec/jbig2/JBig2_SddProc.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_SddProc.cpp
@@ -35,7 +35,6 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Arith(
FX_DWORD nTmp;
FX_DWORD SBNUMSYMS;
uint8_t SBSYMCODELEN;
- FX_DWORD IDI;
int32_t RDXI, RDYI;
CJBig2_Image** SBSYMS;
nonstd::unique_ptr<CJBig2_ArithIaidDecoder> IAID;
@@ -65,7 +64,7 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Arith(
NSYMSDECODED = 0;
while (NSYMSDECODED < SDNUMNEWSYMS) {
BS = nullptr;
- if (IADH->decode(pArithDecoder, &HCDH) == -1) {
+ if (!IADH->decode(pArithDecoder, &HCDH)) {
goto failed;
}
HCHEIGHT = HCHEIGHT + HCDH;
@@ -116,7 +115,7 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Arith(
goto failed;
}
} else {
- if (IAAI->decode(pArithDecoder, (int*)&REFAGGNINST) == -1) {
+ if (!IAAI->decode(pArithDecoder, (int*)&REFAGGNINST)) {
goto failed;
}
if (REFAGGNINST > 1) {
@@ -209,11 +208,10 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Arith(
FX_Free(SBSYMS);
} else if (REFAGGNINST == 1) {
SBNUMSYMS = SDNUMINSYMS + NSYMSDECODED;
- if (IAID->decode(pArithDecoder, (int*)&IDI) == -1) {
- goto failed;
- }
- if ((IARDX->decode(pArithDecoder, &RDXI) == -1) ||
- (IARDY->decode(pArithDecoder, &RDYI) == -1)) {
+ FX_DWORD IDI;
+ IAID->decode(pArithDecoder, &IDI);
+ if (!IARDX->decode(pArithDecoder, &RDXI) ||
+ !IARDY->decode(pArithDecoder, &RDYI)) {
goto failed;
}
if (IDI >= SBNUMSYMS) {
@@ -256,7 +254,7 @@ CJBig2_SymbolDict* CJBig2_SDDProc::decode_Arith(
CUREXFLAG = 0;
EXFLAGS = FX_Alloc(FX_BOOL, SDNUMINSYMS + SDNUMNEWSYMS);
while (EXINDEX < SDNUMINSYMS + SDNUMNEWSYMS) {
- if (IAEX->decode(pArithDecoder, (int*)&EXRUNLENGTH) == -1) {
+ if (!IAEX->decode(pArithDecoder, (int*)&EXRUNLENGTH)) {
FX_Free(EXFLAGS);
goto failed;
}