summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_font
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-06-19 17:26:17 -0700
committerLei Zhang <thestig@chromium.org>2015-06-19 17:26:17 -0700
commit6d8b1c2c7b1cbada20109f70ae971a4192330bb5 (patch)
treee755b7cb2624622cba606134493d25fb7f1ce6c8 /core/src/fpdfapi/fpdf_font
parent9883a7da2d4f31910073c03e703d5b97a45d9254 (diff)
downloadpdfium-6d8b1c2c7b1cbada20109f70ae971a4192330bb5.tar.xz
Merge to XFA: Cleanup: Do not check pointers before deleting them.
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1192743004. (cherry picked from commit cfac954abcab7caf47d3fa3d641c553cba998271) Review URL: https://codereview.chromium.org/1196783003.
Diffstat (limited to 'core/src/fpdfapi/fpdf_font')
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font.cpp8
-rw-r--r--core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp16
-rw-r--r--core/src/fpdfapi/fpdf_font/ttgsubtable.h12
3 files changed, 9 insertions, 27 deletions
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
index 14207f7e6b..e7072e8d55 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font.cpp
@@ -1744,10 +1744,6 @@ CPDF_Type3Char::CPDF_Type3Char()
}
CPDF_Type3Char::~CPDF_Type3Char()
{
- if (m_pForm) {
- delete m_pForm;
- }
- if (m_pBitmap) {
- delete m_pBitmap;
- }
+ delete m_pForm;
+ delete m_pBitmap;
}
diff --git a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
index 0b4064b3c6..7dd019da85 100644
--- a/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
+++ b/core/src/fpdfapi/fpdf_font/fpdf_font_cid.cpp
@@ -300,9 +300,7 @@ CPDF_CMap::~CPDF_CMap()
if (m_pLeadingBytes) {
FX_Free(m_pLeadingBytes);
}
- if (m_pUseMap) {
- delete m_pUseMap;
- }
+ delete m_pUseMap;
}
void CPDF_CMap::Release()
{
@@ -710,15 +708,9 @@ CPDF_CIDFont::~CPDF_CIDFont()
if (m_pAnsiWidths) {
FX_Free(m_pAnsiWidths);
}
- if (m_pAllocatedCMap) {
- delete m_pAllocatedCMap;
- }
- if (m_pCIDToGIDMap) {
- delete m_pCIDToGIDMap;
- }
- if (m_pTTGSUBTable) {
- delete m_pTTGSUBTable;
- }
+ delete m_pAllocatedCMap;
+ delete m_pCIDToGIDMap;
+ delete m_pTTGSUBTable;
}
FX_WORD CPDF_CIDFont::CIDFromCharCode(FX_DWORD charcode) const
{
diff --git a/core/src/fpdfapi/fpdf_font/ttgsubtable.h b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
index 69ccc3e453..1b18f82d6e 100644
--- a/core/src/fpdfapi/fpdf_font/ttgsubtable.h
+++ b/core/src/fpdfapi/fpdf_font/ttgsubtable.h
@@ -282,9 +282,7 @@ private:
}
~TSingleSubstFormat1()
{
- if(Coverage) {
- delete Coverage;
- }
+ delete Coverage;
}
private:
TSingleSubstFormat1(const TSingleSubstFormat1&);
@@ -300,12 +298,8 @@ private:
}
~TSingleSubstFormat2()
{
- if(Coverage) {
- delete Coverage;
- }
- if(Substitute) {
- delete[] Substitute;
- }
+ delete Coverage;
+ delete[] Substitute;
}
private:
TSingleSubstFormat2(const TSingleSubstFormat2&);