Add a test case for bad SMask rendering.

BUG=pdfium:1236

Change-Id: Iaeb4494200b59f61223d86dcb88903d014ff766b
Reviewed-on: https://pdfium-review.googlesource.com/c/50810
Commit-Queue: Lei Zhang <thestig@chromium.org>
Reviewed-by: Tom Sepez <tsepez@chromium.org>
diff --git a/testing/resources/pixel/bug_1236.in b/testing/resources/pixel/bug_1236.in
new file mode 100644
index 0000000..d99eabc
--- /dev/null
+++ b/testing/resources/pixel/bug_1236.in
@@ -0,0 +1,77 @@
+{{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 400 400]
+  /Resources <<
+    /XObject << /Xop2 5 0 R >>
+  >>
+>>
+endobj
+{{object 4 0}} <<
+  {{streamlen}}
+>>
+stream
+q
+200 0 0 200 0 0 cm
+/Xop2 Do
+Q
+endstream
+endobj
+{{object 5 0}} <<
+  /Type /XObject
+  /Subtype /Image
+  /Width 400
+  /Height 400
+  /BitsPerComponent 1
+  /Filter [/ASCIIHexDecode /JBIG2Decode]
+  /ColorSpace /DeviceGray
+  /JBIG2Globals 6 0 R
+  /SMask 7 0 R
+  {{streamlen}}
+>>
+stream
+000000003000010000001300000dea00000353000017110000171151000000000001260001000000
+3500000dea000003530000000000000000020003fffdff02fefefeff7f86530fb6c922cfff7fff7f
+ff7fff7fff7fff7fff7fff7fffac
+endstream
+endobj
+{{object 6 0}} <<
+  /Filter /ASCIIHexDecode
+  {{streamlen}}
+>>
+stream
+0000000000010000000027000003fffdff02fefefe00000001000000010aabcf6e691c9aa3b0303f
+ff7fff7fff7f4fdfffac
+endstream
+endobj
+{{object 7 0}} <<
+  /Type /XObject
+  /Subtype /Image
+  /Width 100
+  /Height 100
+  /BitsPerComponent 8
+  /ColorSpace /DeviceGray
+  /Filter [/ASCIIHexDecode /FlateDecode]
+  {{streamlen}}
+>>
+stream
+789cedc1310100000c02a0dd6b60ffa2a6f003120000000060ed0000000080b92f6770e862
+endstream
+endobj
+{{xref}}
+{{trailer}}
+{{startxref}}
+%%EOF
diff --git a/testing/resources/pixel/bug_1236_expected.pdf.0.png b/testing/resources/pixel/bug_1236_expected.pdf.0.png
new file mode 100644
index 0000000..114e34a
--- /dev/null
+++ b/testing/resources/pixel/bug_1236_expected.pdf.0.png
Binary files differ