summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorweili <weili@chromium.org>2016-12-07 11:32:52 -0800
committerCommit bot <commit-bot@chromium.org>2016-12-07 11:32:53 -0800
commitab5a20d9de8c801b8376bfe2d6f7cf9ac7d26028 (patch)
tree9b758e430d7bd5216c2801186ae24636c56897d5
parent833619b4441915c7c55085d44b3221eaef0d9800 (diff)
downloadpdfium-ab5a20d9de8c801b8376bfe2d6f7cf9ac7d26028.tar.xz
Fix the way to check terminal field in interactive formchromium/2945
Originally the key "T" was checked which was not correct since that key is optional. Now change to check "FT" as well as its parent's key since this key is also inheritable. BUG=chromium:440132 Review-Url: https://codereview.chromium.org/2554223002
-rw-r--r--DEPS2
-rw-r--r--core/fpdfdoc/cpdf_interform.cpp8
-rw-r--r--testing/SUPPRESSIONS1
3 files changed, 8 insertions, 3 deletions
diff --git a/DEPS b/DEPS
index 592f5b64aa..6f89773b1e 100644
--- a/DEPS
+++ b/DEPS
@@ -15,7 +15,7 @@ vars = {
'gtest_revision': '8245545b6dc9c4703e6496d1efd19e975ad2b038',
'icu_revision': '2341038bf72869a5683a893a2b319a48ffec7f62',
'instrumented_lib_revision': '45f5814b1543e41ea0be54c771e3840ea52cca4a',
- 'pdfium_tests_revision': '943683e198317881f2111e9c55c0bae34b529a33',
+ 'pdfium_tests_revision': '9d17ef47f310332ac64e78e636681d493482a409',
'skia_revision': 'a9fd106d0c4dd5449c607add0716db7bbd81bc73',
'tools_memory_revision': '427f10475e1a8d72424c29d00bf689122b738e5d',
'trace_event_revision': '06294c8a4a6f744ef284cd63cfe54dbf61eea290',
diff --git a/core/fpdfdoc/cpdf_interform.cpp b/core/fpdfdoc/cpdf_interform.cpp
index c323986603..e574e28fe5 100644
--- a/core/fpdfdoc/cpdf_interform.cpp
+++ b/core/fpdfdoc/cpdf_interform.cpp
@@ -1079,8 +1079,12 @@ void CPDF_InterForm::FixPageFields(const CPDF_Page* pPage) {
}
CPDF_FormField* CPDF_InterForm::AddTerminalField(CPDF_Dictionary* pFieldDict) {
- if (!pFieldDict->KeyExist("T"))
- return nullptr;
+ if (!pFieldDict->KeyExist("FT")) {
+ // Key "FT" is required for terminal fields, it is also inheritable.
+ CPDF_Dictionary* pParentDict = pFieldDict->GetDictFor("Parent");
+ if (!pParentDict || !pParentDict->KeyExist("FT"))
+ return nullptr;
+ }
CPDF_Dictionary* pDict = pFieldDict;
CFX_WideString csWName = FPDF_GetFullName(pFieldDict);
diff --git a/testing/SUPPRESSIONS b/testing/SUPPRESSIONS
index e9710e68f8..2d5424751b 100644
--- a/testing/SUPPRESSIONS
+++ b/testing/SUPPRESSIONS
@@ -290,6 +290,7 @@ bug_0_length_line.pdf mac * *
bug_0_width_line.pdf mac * *
bug_434.pdf * * noxfa
bug_434.pdf win * xfa
+bug_440132.pdf mac * *
bug_white_space.pdf mac * *
calcorderindex_test.pdf * * *
calculate_average.pdf mac * *