Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3471)

Unified Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_document.cpp

Issue 361553002: Remove "this==NULL" and adjust corresponding callers (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: change tab to spaces Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: 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 a4982040bf1df95a9a0cf4a2eaa89bdc3a07554b..cd100a80cc07c56f61e210855819f39904fd4578 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;
}

Powered by Google App Engine
This is Rietveld 408576698