summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-02-02 11:22:42 -0800
committerTom Sepez <tsepez@chromium.org>2015-02-02 11:22:42 -0800
commit3795a748bb3fb7fc3f2c6196af1f89627ac37f4e (patch)
tree26d0ce44bf019038406ce1a6fb3cea3caa7d180f
parentd3e247709404e2793ff1c7a6a03e62c7349b2f06 (diff)
downloadpdfium-3795a748bb3fb7fc3f2c6196af1f89627ac37f4e.tar.xz
Merge to XFA: Add embedder test for fix to bug_452455.
Original Review URL: https://codereview.chromium.org/887063003 TBR=thestig@chromium.org Review URL: https://codereview.chromium.org/895713003
-rw-r--r--fpdfsdk/src/fpdfview_embeddertest.cpp8
-rw-r--r--testing/resources/bug_452455.in62
-rw-r--r--testing/resources/bug_452455.pdf83
3 files changed, 152 insertions, 1 deletions
diff --git a/fpdfsdk/src/fpdfview_embeddertest.cpp b/fpdfsdk/src/fpdfview_embeddertest.cpp
index 4827f76839..083925ff61 100644
--- a/fpdfsdk/src/fpdfview_embeddertest.cpp
+++ b/fpdfsdk/src/fpdfview_embeddertest.cpp
@@ -177,7 +177,13 @@ TEST_F(FPDFViewEmbeddertest, NamedDestsByName) {
}
// The following tests pass if the document opens without crashing.
-TEST_F(FPDFViewEmbeddertest, Crashers) {
+TEST_F(FPDFViewEmbeddertest, Crasher1) {
// XFA branch detects this document as bad.
EXPECT_FALSE(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