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

Unified Diff: xfa/fxbarcode/BC_TwoDimWriter.cpp

Issue 1925363002: Do not check pointers before deleting them. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 8 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: xfa/fxbarcode/BC_TwoDimWriter.cpp
diff --git a/xfa/fxbarcode/BC_TwoDimWriter.cpp b/xfa/fxbarcode/BC_TwoDimWriter.cpp
index f0065a02b9e770837dd58610ceb457f011729237..a844bf1c42363a8f3a2a68ad7509096f0c24f99a 100644
--- a/xfa/fxbarcode/BC_TwoDimWriter.cpp
+++ b/xfa/fxbarcode/BC_TwoDimWriter.cpp
@@ -53,6 +53,7 @@ void CBC_TwoDimWriter::RenderDeviceResult(CFX_RenderDevice* device,
}
}
}
+
void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap*& pOutBitmap,
int32_t& e) {
if (m_bFixedSize) {
@@ -80,12 +81,11 @@ void CBC_TwoDimWriter::RenderBitmapResult(CFX_DIBitmap*& pOutBitmap,
}
if (!m_bFixedSize) {
CFX_DIBitmap* pStretchBitmap = pOutBitmap->StretchTo(m_Width, m_Height);
- if (pOutBitmap) {
- delete pOutBitmap;
- }
+ delete pOutBitmap;
pOutBitmap = pStretchBitmap;
}
}
+
void CBC_TwoDimWriter::RenderResult(uint8_t* code,
int32_t codeWidth,
int32_t codeHeight,
« no previous file with comments | « xfa/fxbarcode/BC_BufferedImageLuminanceSource.cpp ('k') | xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698