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

Unified Diff: core/src/fpdfapi/fpdf_page/fpdf_page_graph_state.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_page/fpdf_page_func.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_parser.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_graph_state.cpp
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 f53a5b23a4560cd56bf5249df54d607f34eaf32d..628fb3da996e7cd95b86851469beec38b3e6f996 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();
}
}
« no previous file with comments | « core/src/fpdfapi/fpdf_page/fpdf_page_func.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698