diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-01-08 16:37:24 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-01-08 16:37:24 -0800 |
commit | b07772a31f5dff723af620bc57c71daa246995c0 (patch) | |
tree | 9f825651c0eb1d6a132b4a496649aa56f5404251 /core/src | |
parent | 310d26aadffd2f3141b683f40010109a455b403a (diff) | |
download | pdfium-b07772a31f5dff723af620bc57c71daa246995c0.tar.xz |
Land: Protect against a seg fault in CPDF_StructElementImpl constructor.
patch from issue 680873002 at patchset 40001 (http://crrev.com/680873002#ps40001)
TBR=jam@chromium.org
Review URL: https://codereview.chromium.org/841943003
Diffstat (limited to 'core/src')
-rw-r--r-- | core/src/fpdfdoc/doc_tagged.cpp | 8 |
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); |