Add pixel test for invalid indexed colorspace hival
Demonstrate how an invalid hival parameter for an indexed color space
causes the corresponding image to not be able to be loaded.
Bug: 372749732
Change-Id: Iffcbb06193dc21e3e3b5a7044b7c6e9d974669bc
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/129950
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index aa1db92..b64c659 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -665,6 +665,9 @@
# TODO(crbug.com/346766787): Remove after associated bug is fixed
bug_346766787.in * * * *
+# TODO(crbug.com/372749732): Remove after associated bug is fixed
+bug_372749732.in * * * *
+
# TODO(crbug.com/394767650): Remove after associated bug is fixed
bug_394767650.in * * * *
diff --git a/testing/resources/pixel/bug_372749732.in b/testing/resources/pixel/bug_372749732.in
new file mode 100644
index 0000000..33b8f8f
--- /dev/null
+++ b/testing/resources/pixel/bug_372749732.in
@@ -0,0 +1,67 @@
+{{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 40 60]
+ /Resources <<
+ /XObject <<
+ /Img1 5 0 R
+ >>
+ >>
+>>
+endobj
+{{object 4 0}} <<
+ {{streamlen}}
+>>
+stream
+% Draw yellow background.
+q
+1 1 0 rg
+0 0 40 60 re f
+Q
+% Draw image where the black is masked out to let the yellow show.
+q
+40 0 0 60 0 0 cm
+/Img1 Do
+Q
+endstream
+endobj
+{{object 5 0}} <<
+ /Type /XObject
+ /Subtype /Image
+ /Width 4
+ /Height 4
+ /BitsPerComponent 8
+ /ColorSpace [
+ /Indexed
+ /DeviceRGB
+ 256
+ <000000 FF0000 00FF00 0000FF FFFFFF>
+ ]
+ /Filter /ASCIIHexDecode
+ /Mask [0 0 0 0 0 0] % Mask out black.
+ {{streamlen}}
+>>
+stream
+00 00 01 01
+00 02 02 01
+03 02 02 04
+03 03 04 04
+endstream
+endobj
+{{xref}}
+{{trailer}}
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/bug_372749732_expected.pdf.0.png b/testing/resources/pixel/bug_372749732_expected.pdf.0.png
new file mode 100644
index 0000000..fa2e09b
--- /dev/null
+++ b/testing/resources/pixel/bug_372749732_expected.pdf.0.png
Binary files differ