From b66432c91c35ef49d53377a250f42448bdd8fbf1 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Wed, 9 Jul 2014 14:03:51 -0700 Subject: Fix a null object bug BUG=387975 R=thakis@chromium.org Review URL: https://codereview.chromium.org/379273002 --- core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index 926117722f..b79aad6f23 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -1211,7 +1211,7 @@ CPDF_StreamAcc* CPDF_Parser::GetObjectStream(FX_DWORD objnum) if (m_ObjectStreamMap.Lookup((void*)(FX_UINTPTR)objnum, (void*&)pStreamAcc)) { return pStreamAcc; } - const CPDF_Stream* pStream = (CPDF_Stream*)m_pDocument->GetIndirectObject(objnum); + const CPDF_Stream* pStream = m_pDocument ? (CPDF_Stream*)m_pDocument->GetIndirectObject(objnum) : NULL; if (pStream == NULL || pStream->GetType() != PDFOBJ_STREAM) { return NULL; } -- cgit v1.2.3