summaryrefslogtreecommitdiff
path: root/core/src
diff options
context:
space:
mode:
authorTom Sepez <tsepez@chromium.org>2015-01-08 16:40:19 -0800
committerTom Sepez <tsepez@chromium.org>2015-01-08 16:40:19 -0800
commit1c83be6bedb4dceb06ef7e8e6a5d76105d0fff4d (patch)
tree90aa3f025d15d074e188e83288be41f69a705afe /core/src
parent9478b521b01a9cc94a0d6cfe43b8e0341b5b82eb (diff)
downloadpdfium-1c83be6bedb4dceb06ef7e8e6a5d76105d0fff4d.tar.xz
Merge to XFA: Land: Protect against a seg fault in CPDF_StructElementImpl constructor
Original CL at https://codereview.chromium.org/841943003/ TBR=jam@chromium.org Review URL: https://codereview.chromium.org/845603004
Diffstat (limited to 'core/src')
-rw-r--r--core/src/fpdfdoc/doc_tagged.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/src/fpdfdoc/doc_tagged.cpp b/core/src/fpdfdoc/doc_tagged.cpp
index 698157356c..c5fe39b6ee 100644
--- a/core/src/fpdfdoc/doc_tagged.cpp
+++ b/core/src/fpdfdoc/doc_tagged.cpp
@@ -217,9 +217,11 @@ CPDF_StructElementImpl::CPDF_StructElementImpl(CPDF_StructTreeImpl* pTree, CPDF_
m_pTree = pTree;
m_pDict = pDict;
m_Type = pDict->GetString(FX_BSTRC("S"));
- CFX_ByteString mapped = pTree->m_pRoleMap->GetString(m_Type);
- if (!mapped.IsEmpty()) {
- m_Type = mapped;
+ if (pTree->m_pRoleMap) {
+ CFX_ByteString mapped = pTree->m_pRoleMap->GetString(m_Type);
+ if (!mapped.IsEmpty()) {
+ m_Type = mapped;
+ }
}
m_pParent = pParent;
LoadKids(pDict);