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

Unified Diff: core/src/fpdfapi/fpdf_font/fpdf_font.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_edit/fpdf_edit_create.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_font/fpdf_font.cpp
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index 72b8adbe20022d2c54d372f01c68137660c0a156..b7ca5b1b7df9a35f659f94389485e1e6f23a0eab 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -78,7 +78,9 @@ void CPDF_FontGlobals::Clear(void* key)
CFX_StockFontArray* pStockFonts = (CFX_StockFontArray*)value;
for (int i = 0; i < 14; i ++) {
if (pStockFonts->m_pStockFonts[i]) {
- pStockFonts->m_pStockFonts[i]->GetFontDict()->Release();
+ CPDF_Dictionary* pFontDict = pStockFonts->m_pStockFonts[i]->GetFontDict();
+ if (pFontDict)
+ pFontDict->Release();
delete pStockFonts->m_pStockFonts[i];
}
}
@@ -97,7 +99,9 @@ void CPDF_FontGlobals::ClearAll()
CFX_StockFontArray* pStockFonts = (CFX_StockFontArray*)value;
for (int i = 0; i < 14; i ++) {
if (pStockFonts->m_pStockFonts[i]) {
- pStockFonts->m_pStockFonts[i]->GetFontDict()->Release();
+ CPDF_Dictionary* pFontDict = pStockFonts->m_pStockFonts[i]->GetFontDict();
+ if (pFontDict)
+ pFontDict->Release();
delete pStockFonts->m_pStockFonts[i];
}
}
@@ -1698,7 +1702,7 @@ CPDF_Type3Char* CPDF_Type3Font::LoadChar(FX_DWORD charcode, int level)
if (name == NULL) {
return NULL;
}
- CPDF_Stream* pStream = (CPDF_Stream*)m_pCharProcs->GetElementValue(name);
+ CPDF_Stream* pStream = (CPDF_Stream*)(m_pCharProcs ? m_pCharProcs->GetElementValue(name) : NULL);
if (pStream == NULL || pStream->GetType() != PDFOBJ_STREAM) {
return NULL;
}
« no previous file with comments | « core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp ('k') | core/src/fpdfapi/fpdf_page/fpdf_page.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698