summaryrefslogtreecommitdiff
path: root/core/src/fxge/dib/fx_dib_engine.cpp
diff options
context:
space:
mode:
authorLei Zhang <thestig@chromium.org>2015-08-14 15:45:39 -0700
committerLei Zhang <thestig@chromium.org>2015-08-14 15:45:39 -0700
commitcb62e7657b3a9a04142028a4e6614029a08e894b (patch)
treee7fa5f4c7d7f12bff9315475a89872fb044c36b1 /core/src/fxge/dib/fx_dib_engine.cpp
parent0f6b51c0fdd14f5762bf3c7412ac59c825443cc3 (diff)
downloadpdfium-cb62e7657b3a9a04142028a4e6614029a08e894b.tar.xz
Don't bother checking pointers before delete[] and FX_Free().
R=tsepez@chromium.org Review URL: https://codereview.chromium.org/1297713003 .
Diffstat (limited to 'core/src/fxge/dib/fx_dib_engine.cpp')
-rw-r--r--core/src/fxge/dib/fx_dib_engine.cpp30
1 files changed, 8 insertions, 22 deletions
diff --git a/core/src/fxge/dib/fx_dib_engine.cpp b/core/src/fxge/dib/fx_dib_engine.cpp
index a91d99d935..7443926df4 100644
--- a/core/src/fxge/dib/fx_dib_engine.cpp
+++ b/core/src/fxge/dib/fx_dib_engine.cpp
@@ -16,10 +16,8 @@ void CWeightTable::Calc(int dest_len,
int src_min,
int src_max,
int flags) {
- if (m_pWeightTables) {
- FX_Free(m_pWeightTables);
- m_pWeightTables = NULL;
- }
+ FX_Free(m_pWeightTables);
+ m_pWeightTables = NULL;
double scale, base;
scale = FXSYS_Div((FX_FLOAT)(src_len), (FX_FLOAT)(dest_len));
if (dest_len < 0) {
@@ -334,18 +332,10 @@ FX_BOOL CStretchEngine::Continue(IFX_Pause* pPause) {
return FALSE;
}
CStretchEngine::~CStretchEngine() {
- if (m_pDestScanline) {
- FX_Free(m_pDestScanline);
- }
- if (m_pInterBuf) {
- FX_Free(m_pInterBuf);
- }
- if (m_pExtraAlphaBuf) {
- FX_Free(m_pExtraAlphaBuf);
- }
- if (m_pDestMaskScanline) {
- FX_Free(m_pDestMaskScanline);
- }
+ FX_Free(m_pDestScanline);
+ FX_Free(m_pInterBuf);
+ FX_Free(m_pExtraAlphaBuf);
+ FX_Free(m_pDestMaskScanline);
}
FX_BOOL CStretchEngine::StartStretchHorz() {
if (m_DestWidth == 0 || m_pDestScanline == NULL ||
@@ -769,13 +759,9 @@ CFX_ImageStretcher::CFX_ImageStretcher() {
m_pMaskScanline = NULL;
}
CFX_ImageStretcher::~CFX_ImageStretcher() {
- if (m_pScanline) {
- FX_Free(m_pScanline);
- }
+ FX_Free(m_pScanline);
delete m_pStretchEngine;
- if (m_pMaskScanline) {
- FX_Free(m_pMaskScanline);
- }
+ FX_Free(m_pMaskScanline);
}
FXDIB_Format _GetStretchedFormat(const CFX_DIBSource* pSrc) {
FXDIB_Format format = pSrc->GetFormat();