summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testing/resources/bug_216.in39
-rw-r--r--testing/resources/bug_216.pdf1
-rw-r--r--xfa/src/fxfa/src/parser/xfa_parser_imp.cpp3
-rw-r--r--xfa/src/fxfa/src/parser/xfa_parser_imp_embeddertest.cpp8
4 files changed, 46 insertions, 5 deletions
diff --git a/testing/resources/bug_216.in b/testing/resources/bug_216.in
new file mode 100644
index 0000000000..e8eb5b4cfb
--- /dev/null
+++ b/testing/resources/bug_216.in
@@ -0,0 +1,39 @@
+{{header}}
+{{obj 1 0}} <<
+ /Type /Catalog
+ /Pages 2 0 R
+ /AcroForm 4 0 R
+>>
+endobj
+{{obj 2 0}} <<
+ /Type /Pages
+ /Count 1
+>>
+endobj
+{{obj 4 0}} <<
+ /XFA [
+ (xdp:xdp) 23 0 R
+ (form) 29 0 R
+ (</xdp:xdp>) 30 0 R]
+>>
+endobj
+{{ obj 23 0}} <<
+>>stream
+<?xml version="1.0" encoding="UTF-8"?>
+<xdp:xdp xmlns:xdp="http://www.foxitsoftware.com/">
+endstream
+endobj
+{{obj 29 0}} <<
+>>stream
+<form xmlns="http://www.xfa.org/schema/xfa-form/2.6/">
+</form>
+endstream
+endobj
+{{obj 30 0}} <<
+>>stream
+</xdp:xdp>
+endstream
+endobj
+trailer
+<</Root 1 0 R>>
+%%EOF
diff --git a/testing/resources/bug_216.pdf b/testing/resources/bug_216.pdf
index 1cb88845a4..2d5987277f 100644
--- a/testing/resources/bug_216.pdf
+++ b/testing/resources/bug_216.pdf
@@ -1,4 +1,5 @@
%PDF-1.7
+% ò¤ô
1 0 obj <<
/Type /Catalog
/Pages 2 0 R
diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp
index 66258980e5..e782f064ba 100644
--- a/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_parser_imp.cpp
@@ -484,7 +484,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
pXMLTemplateDOMRoot = pElement;
pXFARootNode->InsertChild(pPacketNode);
}
- } else {
+ } else {
CXFA_Node* pPacketNode = ParseAsXDPPacket(pElement, ePacket);
if (pPacketNode) {
if (pPacketInfo &&
@@ -498,6 +498,7 @@ CXFA_Node* CXFA_SimpleParser::ParseAsXDPPacket_XDP(
}
}
if (!pXMLTemplateDOMRoot) {
+ // No template is found.
return NULL;
}
if (pXMLDatasetsDOMRoot) {
diff --git a/xfa/src/fxfa/src/parser/xfa_parser_imp_embeddertest.cpp b/xfa/src/fxfa/src/parser/xfa_parser_imp_embeddertest.cpp
index 8bff2f6874..5a3059c0f5 100644
--- a/xfa/src/fxfa/src/parser/xfa_parser_imp_embeddertest.cpp
+++ b/xfa/src/fxfa/src/parser/xfa_parser_imp_embeddertest.cpp
@@ -8,8 +8,8 @@
class XFAParserImpEmbeddertest : public EmbedderTest {};
TEST_F(XFAParserImpEmbeddertest, Bug_216) {
- EXPECT_TRUE(OpenDocument("testing/resources/bug_216.pdf"));
- FPDF_PAGE page = LoadPage(0);
- EXPECT_NE(nullptr, page);
- UnloadPage(page);
+ EXPECT_TRUE(OpenDocument("testing/resources/bug_216.pdf"));
+ FPDF_PAGE page = LoadPage(0);
+ EXPECT_NE(nullptr, page);
+ UnloadPage(page);
} \ No newline at end of file