diff options
Diffstat (limited to 'core/fxcodec/jbig2/JBig2_SddProc.cpp')
-rw-r--r-- | core/fxcodec/jbig2/JBig2_SddProc.cpp | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/core/fxcodec/jbig2/JBig2_SddProc.cpp b/core/fxcodec/jbig2/JBig2_SddProc.cpp index ee0c0f37f3..a446dbc6c0 100644 --- a/core/fxcodec/jbig2/JBig2_SddProc.cpp +++ b/core/fxcodec/jbig2/JBig2_SddProc.cpp @@ -68,9 +68,7 @@ std::unique_ptr<CJBig2_SymbolDict> CJBig2_SDDProc::decode_Arith( NSYMSDECODED = 0; while (NSYMSDECODED < SDNUMNEWSYMS) { std::unique_ptr<CJBig2_Image> BS; - if (!IADH->decode(pArithDecoder, &HCDH)) - return nullptr; - + IADH->decode(pArithDecoder, &HCDH); HCHEIGHT = HCHEIGHT + HCDH; if ((int)HCHEIGHT < 0 || (int)HCHEIGHT > JBIG2_MAX_IMAGE_SIZE) return nullptr; @@ -115,8 +113,7 @@ std::unique_ptr<CJBig2_SymbolDict> CJBig2_SDDProc::decode_Arith( if (!BS) return nullptr; } else { - if (!IAAI->decode(pArithDecoder, reinterpret_cast<int*>(&REFAGGNINST))) - return nullptr; + IAAI->decode(pArithDecoder, (int*)&REFAGGNINST); if (REFAGGNINST > 1) { auto pDecoder = pdfium::MakeUnique<CJBig2_TRDProc>(); pDecoder->SBHUFF = SDHUFF; @@ -189,11 +186,12 @@ std::unique_ptr<CJBig2_SymbolDict> CJBig2_SDDProc::decode_Arith( } else if (REFAGGNINST == 1) { SBNUMSYMS = SDNUMINSYMS + NSYMSDECODED; uint32_t IDI; - if (!IAID->decode(pArithDecoder, &IDI) || - !IARDX->decode(pArithDecoder, &RDXI) || - !IARDY->decode(pArithDecoder, &RDYI) || IDI >= SBNUMSYMS) { + IAID->decode(pArithDecoder, &IDI); + IARDX->decode(pArithDecoder, &RDXI); + IARDY->decode(pArithDecoder, &RDYI); + if (IDI >= SBNUMSYMS) return nullptr; - } + SBSYMS.resize(SBNUMSYMS); std::copy(SDINSYMS, SDINSYMS + SDNUMINSYMS, SBSYMS.begin()); for (size_t i = 0; i < NSYMSDECODED; ++i) @@ -227,10 +225,10 @@ std::unique_ptr<CJBig2_SymbolDict> CJBig2_SDDProc::decode_Arith( EXFLAGS.resize(SDNUMINSYMS + SDNUMNEWSYMS); num_ex_syms = 0; while (EXINDEX < SDNUMINSYMS + SDNUMNEWSYMS) { - if (!IAEX->decode(pArithDecoder, (int*)&EXRUNLENGTH) || - EXINDEX + EXRUNLENGTH > SDNUMINSYMS + SDNUMNEWSYMS) { + IAEX->decode(pArithDecoder, (int*)&EXRUNLENGTH); + if (EXINDEX + EXRUNLENGTH > SDNUMINSYMS + SDNUMNEWSYMS) return nullptr; - } + if (EXRUNLENGTH != 0) { for (I = EXINDEX; I < EXINDEX + EXRUNLENGTH; I++) { if (CUREXFLAG) |