diff options
author | Lei Zhang <thestig@chromium.org> | 2015-06-19 17:26:17 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-06-19 17:26:17 -0700 |
commit | 6d8b1c2c7b1cbada20109f70ae971a4192330bb5 (patch) | |
tree | e755b7cb2624622cba606134493d25fb7f1ce6c8 /core/src/fpdfapi/fpdf_render | |
parent | 9883a7da2d4f31910073c03e703d5b97a45d9254 (diff) | |
download | pdfium-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_render')
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp | 16 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp | 4 |
2 files changed, 6 insertions, 14 deletions
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp index 6a876a2390..cdbecd65ea 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_cache.cpp @@ -188,20 +188,14 @@ CPDF_ImageCache::CPDF_ImageCache(CPDF_Document* pDoc, CPDF_Stream* pStream) } CPDF_ImageCache::~CPDF_ImageCache() { - if (m_pCachedBitmap) { - delete m_pCachedBitmap; - m_pCachedBitmap = NULL; - } - if (m_pCachedMask) { - delete m_pCachedMask; - m_pCachedMask = NULL; - } + delete m_pCachedBitmap; + m_pCachedBitmap = NULL; + delete m_pCachedMask; + m_pCachedMask = NULL; } void CPDF_ImageCache::Reset(const CFX_DIBitmap* pBitmap) { - if (m_pCachedBitmap) { - delete m_pCachedBitmap; - } + delete m_pCachedBitmap; m_pCachedBitmap = NULL; if (pBitmap) { m_pCachedBitmap = pBitmap->Clone(); diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp index 5748e23efe..3ee2222d8b 100644 --- a/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp +++ b/core/src/fpdfapi/fpdf_render/fpdf_render_pattern.cpp @@ -994,9 +994,7 @@ void CPDF_RenderStatus::DrawTilingPattern(CPDF_TilingPattern* pPattern, CPDF_Pag m_pDevice->RestoreState(); } m_pDevice->RestoreState(); - if (pStates) { - delete pStates; - } + delete pStates; return; } if (bAligned) { |