summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.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_graph_state.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_graph_state.cpp')
-rw-r--r--core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
index f53a5b23a4..628fb3da99 100644
--- a/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
+++ b/core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.cpp
@@ -194,7 +194,8 @@ void CPDF_ClipPath::AppendTexts(CPDF_TextObject** pTexts, int count)
CPDF_ClipPathData* pData = GetModify();
if (pData->m_TextCount + count > FPDF_CLIPPATH_MAX_TEXTS) {
for (int i = 0; i < count; i ++) {
- pTexts[i]->Release();
+ if (pTexts[i])
+ pTexts[i]->Release();
}
return;
}
@@ -481,7 +482,8 @@ void CPDF_AllStates::ProcessExtGS(CPDF_Dictionary* pGS, CPDF_StreamContentParser
FX_POSITION pos = pGS->GetStartPos();
while (pos) {
CFX_ByteString key_str;
- CPDF_Object* pObject = pGS->GetNextElement(pos, key_str)->GetDirect();
+ CPDF_Object* pElement = pGS->GetNextElement(pos, key_str);
+ CPDF_Object* pObject = pElement ? pElement->GetDirect() : NULL;
if (pObject == NULL) {
continue;
}
@@ -625,7 +627,7 @@ CPDF_ContentMarkItem::CPDF_ContentMarkItem(const CPDF_ContentMarkItem& src)
}
CPDF_ContentMarkItem::~CPDF_ContentMarkItem()
{
- if (m_ParamType == DirectDict) {
+ if (m_ParamType == DirectDict && m_pParam) {
((CPDF_Dictionary*)m_pParam)->Release();
}
}