summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
diff options
context:
space:
mode:
authorBo Xu <bo_xu@foxitsoftware.com>2014-06-30 09:49:21 -0700
committerBo Xu <bo_xu@foxitsoftware.com>2014-06-30 09:49:21 -0700
commit287e11a213d3197ac3e321acf294d903b271c269 (patch)
tree28f6f9dd00331c2748d73f96d818ce04a9775e8d /core/src/fpdfapi/fpdf_page/fpdf_page.cpp
parentad30f609702d232f1708a0792d682c3cfaa0e235 (diff)
downloadpdfium-287e11a213d3197ac3e321acf294d903b271c269.tar.xz
Remove "this==NULL" and adjust corresponding callers
BUG= R=thakis@chromium.org Review URL: https://codereview.chromium.org/361553002
Diffstat (limited to 'core/src/fpdfapi/fpdf_page/fpdf_page.cpp')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page.cpp
index 3cfb93e4bc..500fe4a57f 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) {