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 | |
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')
-rw-r--r-- | core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp | 6 | ||||
-rw-r--r-- | core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp | 10 |
2 files changed, 5 insertions, 11 deletions
diff --git a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp index ff0539c61f..668c70b243 100644 --- a/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp +++ b/core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp @@ -403,7 +403,7 @@ CPDF_FlateEncoder::~CPDF_FlateEncoder() { if (m_bCloned && m_pDict) { m_pDict->Release(); } - if (m_bNewData && m_pData) { + if (m_bNewData) { FX_Free(m_pData); } } @@ -2054,9 +2054,7 @@ void CPDF_Creator::InitID(FX_BOOL bDefault) { CFX_ByteStringC bsBuffer((const uint8_t*)pBuffer, 4 * sizeof(FX_DWORD)); m_pIDArray->Add(CPDF_String::Create(bsBuffer, TRUE), m_pDocument); } - if (pBuffer) { - FX_Free(pBuffer); - } + FX_Free(pBuffer); } if (!bDefault) { return; 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); |