summaryrefslogtreecommitdiff
path: root/core/fpdfapi/parser
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2017-10-20 17:23:40 -0700
committerChromium commit bot <commit-bot@chromium.org>2017-10-21 05:05:12 +0000
commitd78ef3b7c9435f5e066da970da7f28b598b07866 (patch)
treebd1e5756edf622d4a0b949dbf2eaa73b20713b67 /core/fpdfapi/parser
parentd0b48fa54263ac6d5bdd3d7ffadfb7010b9c77da (diff)
downloadpdfium-d78ef3b7c9435f5e066da970da7f28b598b07866.tar.xz
Fix a FPDF_GetMetaText() crash.
With a newly created document, there is no parser. CPDF_Document is missing a nullptr check which can be triggered via FPDF_GetMetaText(). BUG=pdfium:915 Change-Id: If9a300a6dc2ca5914c3544eae5c27fe3139dd821 Reviewed-on: https://pdfium-review.googlesource.com/16490 Commit-Queue: Ryan Harrison <rharrison@chromium.org> Reviewed-by: Ryan Harrison <rharrison@chromium.org>
Diffstat (limited to 'core/fpdfapi/parser')
-rw-r--r--core/fpdfapi/parser/cpdf_document.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/fpdfapi/parser/cpdf_document.cpp b/core/fpdfapi/parser/cpdf_document.cpp
index 6a8ddd1e1c..565886a3a5 100644
--- a/core/fpdfapi/parser/cpdf_document.cpp
+++ b/core/fpdfapi/parser/cpdf_document.cpp
@@ -377,6 +377,9 @@ void CPDF_Document::LoadDocInternal() {
}
void CPDF_Document::LoadDocumentInfo() {
+ if (!m_pParser)
+ return;
+
CPDF_Object* pInfoObj = GetOrParseIndirectObject(m_pParser->GetInfoObjNum());
if (pInfoObj)
m_pInfoDict = pInfoObj->GetDict();