diff options
author | Tom Sepez <tsepez@chromium.org> | 2015-02-05 10:51:54 -0800 |
---|---|---|
committer | Tom Sepez <tsepez@chromium.org> | 2015-02-05 10:51:54 -0800 |
commit | 93daa3c8942b837a948d4803145a07e2fd9c084b (patch) | |
tree | 8d612e9f209b8c17b001f633446fb6aae50e4d02 /core/src/fpdfapi/fpdf_parser | |
parent | 35425896b07b5124651c249d6ce29285cf71ea3b (diff) | |
download | pdfium-93daa3c8942b837a948d4803145a07e2fd9c084b.tar.xz |
Merge to XFA: Fix segv in CPDF_DataAvail::CheckRoot()
Original Review URL: https://codereview.chromium.org/895933003
BUG=454695
TBR=thestig@chromium.org
Review URL: https://codereview.chromium.org/901013003
Diffstat (limited to 'core/src/fpdfapi/fpdf_parser')
-rw-r--r-- | core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index d99390d4e2..ad8adc1c1c 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -3394,7 +3394,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; |