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

Side by Side Diff: core/src/fpdfapi/fpdf_render/fpdf_render_loadimage.cpp

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years, 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "../../../../third_party/base/nonstd_unique_ptr.h" 7 #include "../../../../third_party/base/nonstd_unique_ptr.h"
8 #include "../../../include/fpdfapi/fpdf_module.h" 8 #include "../../../include/fpdfapi/fpdf_module.h"
9 #include "../../../include/fpdfapi/fpdf_pageobj.h" 9 #include "../../../include/fpdfapi/fpdf_pageobj.h"
10 #include "../../../include/fpdfapi/fpdf_render.h" 10 #include "../../../include/fpdfapi/fpdf_render.h"
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
175 m_MatteColor = 0; 175 m_MatteColor = 0;
176 m_pJbig2Context = NULL; 176 m_pJbig2Context = NULL;
177 m_pGlobalStream = NULL; 177 m_pGlobalStream = NULL;
178 m_bStdCS = FALSE; 178 m_bStdCS = FALSE;
179 m_pMaskStream = NULL; 179 m_pMaskStream = NULL;
180 m_Status = 0; 180 m_Status = 0;
181 m_bHasMask = FALSE; 181 m_bHasMask = FALSE;
182 } 182 }
183 CPDF_DIBSource::~CPDF_DIBSource() { 183 CPDF_DIBSource::~CPDF_DIBSource() {
184 delete m_pStreamAcc; 184 delete m_pStreamAcc;
185 if (m_pMaskedLine) {
186 FX_Free(m_pMaskedLine); 185 FX_Free(m_pMaskedLine);
187 }
188 if (m_pLineBuf) {
189 FX_Free(m_pLineBuf); 186 FX_Free(m_pLineBuf);
190 }
191 m_pCachedBitmap.reset(); 187 m_pCachedBitmap.reset();
192 delete m_pDecoder; 188 delete m_pDecoder;
193 if (m_pCompData) {
194 FX_Free(m_pCompData); 189 FX_Free(m_pCompData);
195 }
196 CPDF_ColorSpace* pCS = m_pColorSpace; 190 CPDF_ColorSpace* pCS = m_pColorSpace;
197 if (pCS && m_pDocument) { 191 if (pCS && m_pDocument) {
198 m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray()); 192 m_pDocument->GetPageData()->ReleaseColorSpace(pCS->GetArray());
199 } 193 }
200 if (m_pJbig2Context) { 194 if (m_pJbig2Context) {
201 ICodec_Jbig2Module* pJbig2Module = CPDF_ModuleMgr::Get()->GetJbig2Module(); 195 ICodec_Jbig2Module* pJbig2Module = CPDF_ModuleMgr::Get()->GetJbig2Module();
202 pJbig2Module->DestroyJbig2Context(m_pJbig2Context); 196 pJbig2Module->DestroyJbig2Context(m_pJbig2Context);
203 } 197 }
204 delete m_pGlobalStream; 198 delete m_pGlobalStream;
205 } 199 }
(...skipping 1439 matching lines...) Expand 10 before | Expand all | Expand 10 after
1645 } 1639 }
1646 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) { 1640 FX_BOOL CPDF_ImageLoader::Continue(void* LoadHandle, IFX_Pause* pPause) {
1647 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause); 1641 return ((CPDF_ProgressiveImageLoaderHandle*)LoadHandle)->Continue(pPause);
1648 } 1642 }
1649 CPDF_ImageLoader::~CPDF_ImageLoader() { 1643 CPDF_ImageLoader::~CPDF_ImageLoader() {
1650 if (!m_bCached) { 1644 if (!m_bCached) {
1651 delete m_pBitmap; 1645 delete m_pBitmap;
1652 delete m_pMask; 1646 delete m_pMask;
1653 } 1647 }
1654 } 1648 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698