summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_render
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_render
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_render')
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp6
-rw-r--r--core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp2
2 files changed, 6 insertions, 2 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
index 39241e10f4..1452b9d9f9 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -1082,7 +1082,11 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
CPDF_Array* pBC = pSMaskDict->GetArray(FX_BSTRC("BC"));
FX_ARGB back_color = 0xff000000;
if (pBC) {
- pCSObj = pGroup->GetDict()->GetDict(FX_BSTRC("Group"))->GetElementValue(FX_BSTRC("CS"));
+ CPDF_Dictionary* pDict = pGroup->GetDict();
+ if (pDict && pDict->GetDict(FX_BSTRC("Group")))
+ pCSObj = pDict->GetDict(FX_BSTRC("Group"))->GetElementValue(FX_BSTRC("CS"));
+ else
+ pCSObj = NULL;
pCS = m_pContext->m_pDocument->LoadColorSpace(pCSObj);
if (pCS) {
FX_FLOAT R, G, B;
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
index 91a3725ad7..6befe11ed4 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp
@@ -914,7 +914,7 @@ void CPDF_DIBSource::LoadPalette()
FX_DWORD CPDF_DIBSource::GetValidBpp() const
{
FX_DWORD bpc = m_bpc;
- CPDF_Object * pFilter = m_pDict->GetElementValue(FX_BSTRC("Filter"));
+ CPDF_Object * pFilter = m_pDict ? m_pDict->GetElementValue(FX_BSTRC("Filter")) : NULL;
if (pFilter) {
if (pFilter->GetType() == PDFOBJ_NAME) {
CFX_ByteString filter = pFilter->GetString();