summaryrefslogtreecommitdiff
path: root/core/src/fpdfapi/fpdf_edit
diff options
context:
space:
mode:
Diffstat (limited to 'core/src/fpdfapi/fpdf_edit')
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_create.cpp6
-rw-r--r--core/src/fpdfapi/fpdf_edit/fpdf_edit_image.cpp10
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);