From d78ef3b7c9435f5e066da970da7f28b598b07866 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Fri, 20 Oct 2017 17:23:40 -0700 Subject: 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 Reviewed-by: Ryan Harrison --- core/fpdfapi/parser/cpdf_document.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'core/fpdfapi/parser/cpdf_document.cpp') 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(); -- cgit v1.2.3