diff options
author | Lei Zhang <thestig@chromium.org> | 2015-08-14 22:22:13 -0700 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2015-08-14 22:22:13 -0700 |
commit | da180e9fdd4385df024cc18046f62ca47bc74d74 (patch) | |
tree | 931e0e64ac2cbc82e3718e43418ee6bd676da4a5 /core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp | |
parent | 2b1a2d528469cda4e9f3e36d3c7a649e0d476480 (diff) | |
download | pdfium-da180e9fdd4385df024cc18046f62ca47bc74d74.tar.xz |
Merge to XFA: Don't bother checking pointers before delete[] and FX_Free().
R=tsepez@chromium.org
Review URL: https://codereview.chromium.org/1297713003 .
(cherry picked from commit cb62e7657b3a9a04142028a4e6614029a08e894b)
Review URL: https://codereview.chromium.org/1287053005 .
Diffstat (limited to 'core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp')
-rw-r--r-- | core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp index 9ea94bdd00..488d8393c7 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); |