summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_font
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_font
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_font')
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font.cpp10
1 files changed, 7 insertions, 3 deletions
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index 72b8adbe20..b7ca5b1b7d 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;
}