Fix JPEG2000 decoding when there is no /ColorSpace. Bug: pdfium:304,pdfium:1490 Change-Id: I85ac40a3d802a3e184e3e5a78ca7697b1624a42a Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/67755 Commit-Queue: Lei Zhang <thestig@chromium.org> Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/core/fpdfapi/page/cpdf_dib.cpp b/core/fpdfapi/page/cpdf_dib.cpp index 6b19730..f2d78d7 100644 --- a/core/fpdfapi/page/cpdf_dib.cpp +++ b/core/fpdfapi/page/cpdf_dib.cpp
@@ -929,6 +929,11 @@ // Per spec, |m_bpc| should always be 8 for RunLengthDecode, but too many // documents do not conform to it. So skip this check. + if (filter == "JPXDecode") { + m_bDoBpcCheck = false; + return; + } + if (filter == "CCITTFaxDecode" || filter == "JBIG2Decode") { m_bpc = 1; m_nComponents = 1;
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS index 5aab61e..aefc38c 100644 --- a/testing/SUPPRESSIONS +++ b/testing/SUPPRESSIONS
@@ -325,9 +325,6 @@ # bug_492.in * nov8 * -# TODO(pdfium:304): Remove after associated bug is fixed -bug_304.pdf * * * - # TODO(pdfium:1331): Remove after associated bug is fixed bug_1331.in * * *