Add a pixel test for a mask rendering bug
Demonstrate how a PDF with an XObject that contains an image with a mask
fails to render correctly. The PDF should render as a red square, but
currently renders white. As such, mark the test as suppressed for now.
Bug: 346766787
Change-Id: If72ac03babaeec08033aac1ec1cb334d88967f2f
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/120495
Reviewed-by: Thomas Sepez <tsepez@google.com>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index a625d0b..1d66c26 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -665,6 +665,9 @@
# TODO(chromium:237527): Remove after associated bug is fixed
bug_237527_1.in * * * *
+# TODO(crbug.com/346766787): Remove after associated bug is fixed
+bug_346766787.in * * * *
+
# TODO(chromium:451366): Remove after associated bug is fixed
bug_451366.in * * * agg
diff --git a/testing/resources/pixel/bug_346766787.in b/testing/resources/pixel/bug_346766787.in
new file mode 100644
index 0000000..f519479
--- /dev/null
+++ b/testing/resources/pixel/bug_346766787.in
@@ -0,0 +1,72 @@
+{{header}}
+{{object 1 0}} <<
+ /Type /Catalog
+ /Pages 2 0 R
+>>
+endobj
+{{object 2 0}} <<
+ /Type /Pages
+ /Count 1
+ /Kids [3 0 R]
+>>
+endobj
+{{object 3 0}} <<
+ /Type /Page
+ /Parent 2 0 R
+ /Contents 4 0 R
+ /MediaBox [0 0 200 200]
+ /Resources <<
+ /XObject <<
+ /X0 5 0 R
+ >>
+ >>
+>>
+endobj
+{{object 4 0}} <<
+ {{streamlen}}
+>>
+stream
+q
+1 0 0 rg
+0 0 200 200 re f
+/X0 Do
+Q
+endstream
+endobj
+{{object 5 0}} <<
+ /Type /XObject
+ /Subtype /Form
+ /BBox [0 0 200 200]
+ /Resources <<
+ /XObject <<
+ /IM0 6 0 R
+ >>
+ >>
+ {{streamlen}}
+>>
+stream
+q
+200 0 0 200 0 0 cm
+/IM0 Do
+Q
+endstream
+endobj
+{{object 6 0}} <<
+ /Type /XObject
+ /Subtype /Image
+ /Width 1
+ /Height 1
+ /BitsPerComponent 8
+ /ColorSpace /DeviceCMYK
+ /Filter /ASCIIHexDecode
+ /Mask [0 0 0 0 0 0 0 0]
+ {{streamlen}}
+>>
+stream
+00000000
+endstream
+endobj
+{{xref}}
+{{trailer}}
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/bug_346766787_expected.pdf.0.png b/testing/resources/pixel/bug_346766787_expected.pdf.0.png
new file mode 100644
index 0000000..677492d
--- /dev/null
+++ b/testing/resources/pixel/bug_346766787_expected.pdf.0.png
Binary files differ