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

Unified Diff: core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp

Issue 1195363002: Cleanup: Do not check pointers before deleting them, part 2. (Closed) Base URL: https://pdfium.googlesource.com/pdfium.git@master
Patch Set: nits Created 5 years, 5 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_render/fpdf_render.cpp ('k') | core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
diff --git a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
index f3f0375f533ee9af32b83ff342dd3bdd4c1ffc7d..0730206e23d9de68334217c365f51df2ddb05132 100644
--- a/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
+++ b/core/src/fpdfapi/fpdf_render/fpdf_render_image.cpp
@@ -297,21 +297,13 @@ CPDF_ImageRenderer::CPDF_ImageRenderer()
}
CPDF_ImageRenderer::~CPDF_ImageRenderer()
{
- if (m_pQuickStretcher) {
- delete m_pQuickStretcher;
- }
- if (m_pTransformer) {
- delete m_pTransformer;
- }
+ delete m_pQuickStretcher;
+ delete m_pTransformer;
if (m_DeviceHandle) {
m_pRenderStatus->m_pDevice->CancelDIBits(m_DeviceHandle);
}
- if (m_LoadHandle) {
- delete (CPDF_ProgressiveImageLoaderHandle*)m_LoadHandle;
- }
- if (m_pClone) {
- delete m_pClone;
- }
+ delete (CPDF_ProgressiveImageLoaderHandle*)m_LoadHandle;
+ delete m_pClone;
}
FX_BOOL CPDF_ImageRenderer::StartLoadDIBSource()
{
@@ -813,15 +805,11 @@ CPDF_QuickStretcher::CPDF_QuickStretcher()
}
CPDF_QuickStretcher::~CPDF_QuickStretcher()
{
- if (m_pBitmap) {
- delete m_pBitmap;
- }
+ delete m_pBitmap;
if (m_pCS) {
m_pCS->ReleaseCS();
}
- if (m_pDecoder) {
- delete m_pDecoder;
- }
+ delete m_pDecoder;
}
ICodec_ScanlineDecoder* FPDFAPI_CreateFlateDecoder(const uint8_t* src_buf, FX_DWORD src_size, int width, int height,
int nComps, int bpc, const CPDF_Dictionary* pParams);
@@ -1085,9 +1073,7 @@ CFX_DIBitmap* CPDF_RenderStatus::LoadSMask(CPDF_Dictionary* pSMaskDict,
} else {
FXSYS_memcpy(dest_buf, src_buf, dest_pitch * height);
}
- if (pFunc) {
- delete pFunc;
- }
+ delete pFunc;
FX_Free(pTransfer);
return pMask;
}
« no previous file with comments | « core/src/fpdfapi/fpdf_render/fpdf_render.cpp ('k') | core/src/fxcodec/jbig2/JBig2_GeneralDecoder.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698