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

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page.cpp

Issue 361553002: Remove "this==NULL" and adjust corresponding callers (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: fix if check warning 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
« no previous file with comments | « core/src/fpdfapi/fpdf_font/fpdf_font.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_page/fpdf_page.cpp
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index 3cfb93e4bc41dfac1a4646e505e1327c2898fe53..500fe4a57f7bc10f9b98d62acc2758352ec30be2 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
@@ -841,7 +841,8 @@ void CPDF_Page::Load(CPDF_Document* pDocument, CPDF_Dictionary* pPageDict, FX_BO
m_pPageResources = m_pResources = NULL;
return;
}
- m_pResources = GetPageAttr(FX_BSTRC("Resources"))->GetDict();
+ CPDF_Object* pageAttr = GetPageAttr(FX_BSTRC("Resources"));
+ m_pResources = pageAttr ? pageAttr->GetDict() : NULL;
m_pPageResources = m_pResources;
CPDF_Object* pRotate = GetPageAttr(FX_BSTRC("Rotate"));
int rotate = 0;
@@ -946,7 +947,7 @@ CPDF_Form::CPDF_Form(CPDF_Document* pDoc, CPDF_Dictionary* pPageResources, CPDF_
{
m_pDocument = pDoc;
m_pFormStream = pFormStream;
- m_pFormDict = pFormStream->GetDict();
+ m_pFormDict = pFormStream ? pFormStream->GetDict() : NULL;
m_pResources = m_pFormDict->GetDict(FX_BSTRC("Resources"));
m_pPageResources = pPageResources;
if (m_pResources == NULL) {
« no previous file with comments | « core/src/fpdfapi/fpdf_font/fpdf_font.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_colors.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698