From f3823b2a59d8edf33db552959ad781cfc874811c Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Mon, 2 Feb 2015 10:23:58 -0800 Subject: Add embedder test for fix to bug_452455. BUG=452455 R=thestig@chromium.org Review URL: https://codereview.chromium.org/887063003 --- fpdfsdk/src/fpdfview_embeddertest.cpp | 8 +++- testing/resources/bug_452455.in | 62 ++++++++++++++++++++++++++ testing/resources/bug_452455.pdf | 83 +++++++++++++++++++++++++++++++++++ 3 files changed, 152 insertions(+), 1 deletion(-) create mode 100644 testing/resources/bug_452455.in create mode 100644 testing/resources/bug_452455.pdf diff --git a/fpdfsdk/src/fpdfview_embeddertest.cpp b/fpdfsdk/src/fpdfview_embeddertest.cpp index d0fc40d417..f9b611bbf6 100644 --- a/fpdfsdk/src/fpdfview_embeddertest.cpp +++ b/fpdfsdk/src/fpdfview_embeddertest.cpp @@ -177,6 +177,12 @@ TEST_F(FPDFViewEmbeddertest, NamedDestsByName) { } // The following tests pass if the document opens without crashing. -TEST_F(FPDFViewEmbeddertest, Crashers) { +TEST_F(FPDFViewEmbeddertest, Crasher1) { EXPECT_TRUE(OpenDocument("testing/resources/bug_451830.pdf")); } + +TEST_F(FPDFViewEmbeddertest, Crasher2) { + EXPECT_TRUE(OpenDocument("testing/resources/bug_452455.pdf")); + FPDF_PAGE page = LoadPage(0); + EXPECT_NE(nullptr, page); +} diff --git a/testing/resources/bug_452455.in b/testing/resources/bug_452455.in new file mode 100644 index 0000000000..461765a528 --- /dev/null +++ b/testing/resources/bug_452455.in @@ -0,0 +1,62 @@ +{{header}} +{{object 1 0}} << + /Type /Catalog + /Pages 2 0 R +>> +endobj +{{object 2 0}} << + /Type /Pages + /Kids [3 0 R] + /Count 1 +>> +endobj +{{object 3 0}} << + /Type /Page + /Resources 11 0 R + /Contents 10 0 R + /Parent 2 0 R +>> +endobj +{{object 10 0}} << +>> +stream +BT +/CS2 cs 1 scn +ET +endstream +endobj +{{object 11 0}} << + /ColorSpace << + /CS2 12 0 R + >> +>> +endobj +{{object 12 0}} [ + /Separation /All [] 17 0 R +] +endobj +{{object 17 0}} << + /FunctionType 0 + /Range [0 1] + /BitsPerSample 8 + /Length 536870911 + /Domain [0 1] + /Size [536870910] +>> +stream +% no end stream keyword here +endobj +{{object 16 0}} << + /Type /Halftone + /HalftoneType 1 + /Frequency 53 + /SpotFunction /Round + /Angle 45 +>> +endobj +{{xref}} +trailer << + /Root 1 0 R +>> +{{startxref}} +%%EOF diff --git a/testing/resources/bug_452455.pdf b/testing/resources/bug_452455.pdf new file mode 100644 index 0000000000..35d067cb29 --- /dev/null +++ b/testing/resources/bug_452455.pdf @@ -0,0 +1,83 @@ +%PDF-1.7 +% ò¤ô +1 0 obj << + /Type /Catalog + /Pages 2 0 R +>> +endobj +2 0 obj << + /Type /Pages + /Kids [3 0 R] + /Count 1 +>> +endobj +3 0 obj << + /Type /Page + /Resources 11 0 R + /Contents 10 0 R + /Parent 2 0 R +>> +endobj +10 0 obj << +>> +stream +BT +/CS2 cs 1 scn +ET +endstream +endobj +11 0 obj << + /ColorSpace << + /CS2 12 0 R + >> +>> +endobj +12 0 obj [ + /Separation /All [] 17 0 R +] +endobj +17 0 obj << + /FunctionType 0 + /Range [0 1] + /BitsPerSample 8 + /Length 536870911 + /Domain [0 1] + /Size [536870910] +>> +stream +% no end stream keyword here +endobj +16 0 obj << + /Type /Halftone + /HalftoneType 1 + /Frequency 53 + /SpotFunction /Round + /Angle 45 +>> +endobj +xref +0 18 +0000000000 65536 f +0000000015 00000 n +0000000068 00000 n +0000000131 00000 n +0000000000 65536 f +0000000000 65536 f +0000000000 65536 f +0000000000 65536 f +0000000000 65536 f +0000000000 65536 f +0000000221 00000 n +0000000280 00000 n +0000000340 00000 n +0000000000 65536 f +0000000000 65536 f +0000000000 65536 f +0000000555 00000 n +0000000389 00000 n +trailer << + /Root 1 0 R +>> +startxref +664 +%%EOF -- cgit v1.2.3