Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2641)

Unified Diff: core/src/fpdfdoc/doc_tagged.cpp

Issue 841943003: Land: Protect against a seg fault in CPDF_StructElementImpl constructor. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfdoc/doc_tagged.cpp
diff --git a/core/src/fpdfdoc/doc_tagged.cpp b/core/src/fpdfdoc/doc_tagged.cpp
index 698157356c228fda50755f84945d36dbe4e038ab..c5fe39b6ee8b6cdc1344ded31d0295ecb4b38771 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);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698