Add a pixel test for PDF with illegal CIDToGIDMap stream. The PDF Reference, Sixth Edition, specifies that a CIDToGIDMap "may appear only in a Type 2 CIDFont whose associated True Type font program is embedded in the PDF file" (Section 5.6, pp 437). But some PDFs, which use Type 2 CIDFont, contain CIDToGIDMap streams even when the font is not embedded. This CL adds a pixel test for Type2 CIDFont (with illegal CIDToGIDMap stream and no CID2UnicodeMap) in addition to a pixel test named bug_1308.pdf (with illegal CIDToGIDMap stream and CID2UnicodeMap loaded from predefined CMap (depending on Encoding value)). Bug: pdfium:1308 Change-Id: I10ae0189ba667c9a7093f8bee1cf77876d611db5 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/62211 Commit-Queue: Hui Yingst <nigi@chromium.org> Reviewed-by: Lei Zhang <thestig@chromium.org>
diff --git a/testing/resources/pixel/bug_1308_1.in b/testing/resources/pixel/bug_1308_1.in new file mode 100644 index 0000000..5b9ab3b --- /dev/null +++ b/testing/resources/pixel/bug_1308_1.in
@@ -0,0 +1,85 @@ +{{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 + /Resources << + /ProcSet [/PDF /Text /ImageB /ImageC /ImageI] + /Font << + /F7 5 0 R + >> + >> + /MediaBox [0 0 200 200] +>> +endobj +{{object 4 0}} << + {{streamlen}} +>> +stream +0 0 0 rg +BT +10 0 0 10 100 100 Tm +/F7 2 Tf +(\000\000) Tj +ET +endstream +endobj +{{object 5 0}} << + /Type /Font + /Subtype /Type0 + /BaseFont /ArialMT + /Encoding /Identity-H + /ToUnicode /Identity-H + /DescendantFonts [6 0 R] +>> +endobj +{{object 6 0}} << + /Type /Font + /Subtype /CIDFontType2 + /DW 735 + /CIDSystemInfo << + /Supplement 0 + /Registry (Adobe) + /Ordering (Identity) + >> + /BaseFont /ArialMT + /FontDescriptor 7 0 R + /CIDToGIDMap 8 0 R +>> +endobj +{{object 7 0}} << + /Type /FontDescriptor + /Descent -211 + /CapHeight 715 + /StemV 86 + /Flags 4 + /MaxWidth 1101 + /FontName /ArialMT + /ItalicAngle 0 + /Ascent 905 + /FontBBox [-664 -324 2000 1005] +>> +endobj +{{object 8 0}} << + {{streamlen}} + /Filter /ASCIIHexDecode +>> +stream +0191 +endstream +endobj +{{xref}} +{{trailer}} +{{startxref}} +%%EOF
diff --git a/testing/resources/pixel/bug_1308_1_expected.pdf.0.png b/testing/resources/pixel/bug_1308_1_expected.pdf.0.png new file mode 100644 index 0000000..44c0446 --- /dev/null +++ b/testing/resources/pixel/bug_1308_1_expected.pdf.0.png Binary files differ
diff --git a/testing/resources/pixel/bug_1308_1_expected_win.pdf.0.png b/testing/resources/pixel/bug_1308_1_expected_win.pdf.0.png new file mode 100644 index 0000000..70d0f23 --- /dev/null +++ b/testing/resources/pixel/bug_1308_1_expected_win.pdf.0.png Binary files differ