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

Unified Diff: core/src/fpdfapi/fpdf_edit/fpdf_edit_image.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 side-by-side diff with in-line comments
Download patch
Index: core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
index 9ea94bdd0047cc59c0982bf0a3ac4cf65f04cc71..488d8393c79ce247a05560d7ea57943b1e8be741 100644
--- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
+++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp
@@ -278,10 +278,8 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap,
pDict->Release();
pDict = NULL;
}
- if (dest_buf) {
- FX_Free(dest_buf);
- dest_buf = NULL;
- }
+ FX_Free(dest_buf);
+ dest_buf = NULL;
dest_size = 0;
delete pNewBitmap;
return;
@@ -380,9 +378,7 @@ void CPDF_Image::SetImage(const CFX_DIBitmap* pBitmap,
m_bIsMask = pBitmap->IsAlphaMask();
m_Width = BitmapWidth;
m_Height = BitmapHeight;
- if (dest_buf) {
- FX_Free(dest_buf);
- }
+ FX_Free(dest_buf);
}
void CPDF_Image::ResetCache(CPDF_Page* pPage, const CFX_DIBitmap* pBitmap) {
pPage->GetRenderCache()->ResetBitmap(m_pStream, pBitmap);

Powered by Google App Engine
This is Rietveld 408576698