summaryrefslogtreecommitdiff
path: root/core/fxcodec/jbig2/JBig2_TrdProc.cpp
diff options
context:
space:
mode:
authorNicolás Peña Moreno <npm@chromium.org>2018-01-15 21:47:45 +0000
committerChromium commit bot <commit-bot@chromium.org>2018-01-15 21:47:45 +0000
commitb36c7e1f84ea7402b7576d2a03a219d469735434 (patch)
treea505fc198c18a21f5483eb0c981fd10c71027e0c /core/fxcodec/jbig2/JBig2_TrdProc.cpp
parent6e22f26ac67ac8876e50f38f1dcf4dddb4c818a4 (diff)
downloadpdfium-b36c7e1f84ea7402b7576d2a03a219d469735434.tar.xz
Revert "Check for success of decodes to avoid infinite loops"
This reverts commit dca380ffe0571be4023b11b06b8aecad9934bb06. Reason for revert: Causes missing text in a user's PDF Original change's description: > Check for success of decodes to avoid infinite loops > > Bug: 790693 > Change-Id: I9b1d87e024229d8b01f55ec554e2cc544db6ac06 > Reviewed-on: https://pdfium-review.googlesource.com/20230 > Reviewed-by: Henrique Nakashima <hnakashima@chromium.org> > Commit-Queue: Nicolás Peña Moreno <npm@chromium.org> TBR=npm@chromium.org,hnakashima@chromium.org,rharrison@chromium.org # Not skipping CQ checks because original CL landed > 1 day ago. Bug: 790693 Change-Id: I886b14e120c34da757a96f8a1f9c6a081d8326b6 Reviewed-on: https://pdfium-review.googlesource.com/22950 Reviewed-by: Nicolás Peña Moreno <npm@chromium.org> Commit-Queue: Nicolás Peña Moreno <npm@chromium.org>
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_TrdProc.cpp')
-rw-r--r--core/fxcodec/jbig2/JBig2_TrdProc.cpp31
1 files changed, 12 insertions, 19 deletions
diff --git a/core/fxcodec/jbig2/JBig2_TrdProc.cpp b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
index 78eb78012a..332e5868ac 100644
--- a/core/fxcodec/jbig2/JBig2_TrdProc.cpp
+++ b/core/fxcodec/jbig2/JBig2_TrdProc.cpp
@@ -281,9 +281,7 @@ std::unique_ptr<CJBig2_Image> CJBig2_TRDProc::decode_Arith(
for (;;) {
if (bFirst) {
int32_t DFS;
- if (!pIAFS->decode(pArithDecoder, &DFS))
- return nullptr;
-
+ pIAFS->decode(pArithDecoder, &DFS);
FIRSTS += DFS;
CURS = FIRSTS;
bFirst = false;
@@ -299,10 +297,8 @@ std::unique_ptr<CJBig2_Image> CJBig2_TRDProc::decode_Arith(
break;
int CURT = 0;
- if (SBSTRIPS != 1) {
- if (!pIAIT->decode(pArithDecoder, &CURT))
- return nullptr;
- }
+ if (SBSTRIPS != 1)
+ pIAIT->decode(pArithDecoder, &CURT);
FX_SAFE_INT32 SAFE_TI = STRIPT + CURT;
if (!SAFE_TI.IsValid())
@@ -310,16 +306,15 @@ std::unique_ptr<CJBig2_Image> CJBig2_TRDProc::decode_Arith(
int32_t TI = SAFE_TI.ValueOrDie();
uint32_t IDI;
- if (!pIAID->decode(pArithDecoder, &IDI) || IDI >= SBNUMSYMS)
+ pIAID->decode(pArithDecoder, &IDI);
+ if (IDI >= SBNUMSYMS)
return nullptr;
int RI;
- if (SBREFINE == 0) {
+ if (SBREFINE == 0)
RI = 0;
- } else {
- if (!pIARI->decode(pArithDecoder, &RI))
- return nullptr;
- }
+ else
+ pIARI->decode(pArithDecoder, &RI);
MaybeOwned<CJBig2_Image> pIBI;
if (RI == 0) {
@@ -329,12 +324,10 @@ std::unique_ptr<CJBig2_Image> CJBig2_TRDProc::decode_Arith(
int32_t RDHI;
int32_t RDXI;
int32_t RDYI;
- if (!pIARDW->decode(pArithDecoder, &RDWI) ||
- !pIARDH->decode(pArithDecoder, &RDHI) ||
- !pIARDX->decode(pArithDecoder, &RDXI) ||
- !pIARDY->decode(pArithDecoder, &RDYI)) {
- return nullptr;
- }
+ pIARDW->decode(pArithDecoder, &RDWI);
+ pIARDH->decode(pArithDecoder, &RDHI);
+ pIARDX->decode(pArithDecoder, &RDXI);
+ pIARDY->decode(pArithDecoder, &RDYI);
CJBig2_Image* IBOI = SBSYMS[IDI];
if (!IBOI)
return nullptr;