From 287e11a213d3197ac3e321acf294d903b271c269 Mon Sep 17 00:00:00 2001 From: Bo Xu Date: Mon, 30 Jun 2014 09:49:21 -0700 Subject: Remove "this==NULL" and adjust corresponding callers BUG= R=thakis@chromium.org Review URL: https://codereview.chromium.org/361553002 --- core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp') diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp index a4982040bf..cd100a80cc 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp @@ -61,11 +61,13 @@ void CPDF_Document::LoadAsynDoc(CPDF_Dictionary *pLinearized) { m_bLinearized = TRUE; m_LastObjNum = m_pParser->GetLastObjNum(); - m_pRootDict = GetIndirectObject(m_pParser->GetRootObjNum())->GetDict(); + CPDF_Object* indirectObj = GetIndirectObject(m_pParser->GetRootObjNum()); + m_pRootDict = indirectObj ? indirectObj->GetDict() : NULL; if (m_pRootDict == NULL) { return; } - m_pInfoDict = GetIndirectObject(m_pParser->GetInfoObjNum())->GetDict(); + indirectObj = GetIndirectObject(m_pParser->GetInfoObjNum()); + m_pInfoDict = indirectObj ? indirectObj->GetDict() : NULL; CPDF_Array* pIDArray = m_pParser->GetIDArray(); if (pIDArray) { m_ID1 = pIDArray->GetString(0); @@ -336,7 +338,7 @@ FX_BOOL CPDF_Document::IsContentUsedElsewhere(FX_DWORD objnum, CPDF_Dictionary* if (pPageDict == pThisPageDict) { continue; } - CPDF_Object* pContents = pPageDict->GetElement(FX_BSTRC("Contents")); + CPDF_Object* pContents = pPageDict ? pPageDict->GetElement(FX_BSTRC("Contents")) : NULL; if (pContents == NULL) { continue; } -- cgit v1.2.3