Index: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp |
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp |
index 16274088c0de9b5d042d77824feb796be5f7c3cf..4ed4c70e27f581f9aae406c3911c89cd55379959 100644 |
--- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp |
+++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp |
@@ -3390,7 +3390,12 @@ FX_BOOL CPDF_DataAvail::CheckRoot(IFX_DownloadHints* pHints) |
} |
return FALSE; |
} |
- CPDF_Reference* pRef = (CPDF_Reference*)m_pRoot->GetDict()->GetElement(FX_BSTRC("Pages")); |
+ CPDF_Dictionary* pDict = m_pRoot->GetDict(); |
+ if (!pDict) { |
+ m_docStatus = PDF_DATAAVAIL_ERROR; |
+ return FALSE; |
+ } |
+ CPDF_Reference* pRef = (CPDF_Reference*)pDict->GetElement(FX_BSTRC("Pages")); |
if (pRef == NULL || pRef->GetType() != PDFOBJ_REFERENCE) { |
m_docStatus = PDF_DATAAVAIL_ERROR; |
return FALSE; |