summaryrefslogtreecommitdiff
path: root/testing
diff options
context:
space:
mode:
authorJUN FANG <jun_fang@foxitsoftware.com>2015-03-05 13:39:21 -0800
committerJUN FANG <jun_fang@foxitsoftware.com>2015-03-05 13:39:21 -0800
commit827a1722f70e7092270b5e0fdfba1e9c0b1ac50f (patch)
tree4f54a77d5b14d0ee3cce0e210fd8c450f7a92042 /testing
parent2785fb46249df5229e057917e54fe161bb0e3517 (diff)
downloadpdfium-827a1722f70e7092270b5e0fdfba1e9c0b1ac50f.tar.xz
Check whether a pdf has XFA fields before loading XFA fields
BUG=452793 R=tsepez@chromium.org Review URL: https://codereview.chromium.org/973673002
Diffstat (limited to 'testing')
-rw-r--r--testing/embedder_test.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/testing/embedder_test.cpp b/testing/embedder_test.cpp
index cf0bdf892c..563dec8bec 100644
--- a/testing/embedder_test.cpp
+++ b/testing/embedder_test.cpp
@@ -261,7 +261,12 @@ bool EmbedderTest::OpenDocument(const std::string& filename) {
if (!document_) {
return false;
}
- (void) FPDF_LoadXFA(document_);
+ int docType = DOCTYPE_PDF;
+ if (FPDF_HasXFAField(document_, docType))
+ {
+ if (docType != DOCTYPE_PDF)
+ (void) FPDF_LoadXFA(document_);
+ }
(void) FPDF_GetDocPermissions(document_);
(void) FPDFAvail_IsFormAvail(avail_, &hints_);