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

Unified Diff: core/src/fxcodec/jbig2/JBig2_SddProc.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
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp ('k') | core/src/fxcodec/jbig2/JBig2_TrdProc.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcodec/jbig2/JBig2_SddProc.cpp
diff --git a/core/src/fxcodec/jbig2/JBig2_SddProc.cpp b/core/src/fxcodec/jbig2/JBig2_SddProc.cpp
index ae5635b462d30aaf6f4e3d4427699cc17cc48fff..924d25e3c430150e373ed50a7b8a2a893b45663d 100644
--- a/core/src/fxcodec/jbig2/JBig2_SddProc.cpp
+++ b/core/src/fxcodec/jbig2/JBig2_SddProc.cpp
@@ -65,7 +65,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 +116,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 +209,9 @@ 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)) {
+ IAID->decode(pArithDecoder, reinterpret_cast<int*>(&IDI));
Tom Sepez 2015/09/29 17:46:36 Technically, an illegal cast, since there's no rea
Lei Zhang 2015/09/30 05:12:19 Done.
+ 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;
}
« no previous file with comments | « core/src/fxcodec/jbig2/JBig2_ArithIntDecoder.cpp ('k') | core/src/fxcodec/jbig2/JBig2_TrdProc.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698