Correctly handle decoders in CPDF_DIBBase::ContinueLoadDIBBase(). Fix SMask rendering when the SMask is not JBIG2. BUG=pdfium:1236 Change-Id: Ic06410f52515ede252886300d447a00ca18104db Reviewed-on: https://pdfium-review.googlesource.com/c/50830 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/render/cpdf_dibbase.cpp b/core/fpdfapi/render/cpdf_dibbase.cpp index b325edb..322e76a 100644 --- a/core/fpdfapi/render/cpdf_dibbase.cpp +++ b/core/fpdfapi/render/cpdf_dibbase.cpp
@@ -291,14 +291,16 @@ if (m_Status == LoadState::kContinue) return ContinueLoadMaskDIB(pPause); - if (m_Status == LoadState::kFail) - return LoadState::kFail; - ByteString decoder = m_pStreamAcc->GetImageDecoder(); if (decoder == "JPXDecode") return LoadState::kFail; - ASSERT(decoder == "JBIG2Decode"); + if (decoder != "JBIG2Decode") + return LoadState::kSuccess; + + if (m_Status == LoadState::kFail) + return LoadState::kFail; + FXCODEC_STATUS iDecodeStatus; CCodec_Jbig2Module* pJbig2Module = CPDF_ModuleMgr::Get()->GetJbig2Module(); if (!m_pJbig2Context) {
diff --git a/testing/resources/pixel/bug_1236_expected.pdf.0.png b/testing/resources/pixel/bug_1236_expected.pdf.0.png index 114e34a..2020fec 100644 --- a/testing/resources/pixel/bug_1236_expected.pdf.0.png +++ b/testing/resources/pixel/bug_1236_expected.pdf.0.png Binary files differ