diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-02-02 10:23:58 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-02-02 10:23:58 -0800 |
commit | f3823b2a59d8edf33db552959ad781cfc874811c (patch) | |
tree | 9deda251c6e4d5a542b905596a10d6fe1e30b9e6 | |
parent | b3a788e5e37955620b26be5b6e3048d37b605e00 (diff) | |
download | pdfium-f3823b2a59d8edf33db552959ad781cfc874811c.tar.xz |
Add embedder test for fix to bug_452455.
BUG=452455
R=thestig@chromium.org
Review URL: https://codereview.chromium.org/887063003
-rw-r--r-- | fpdfsdk/src/fpdfview_embeddertest.cpp | 8 | ||||
-rw-r--r-- | testing/resources/bug_452455.in | 62 | ||||
-rw-r--r-- | testing/resources/bug_452455.pdf | 83 |
3 files changed, 152 insertions, 1 deletions
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 |