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

Unified Diff: xfa/fxbarcode/oned/BC_OneDimWriter.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
« no previous file with comments | « xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp ('k') | xfa/fxbarcode/pdf417/BC_PDF417.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: xfa/fxbarcode/oned/BC_OneDimWriter.cpp
diff --git a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp
index b95c2be283d31a86e6dd4553929fd6f3e82b4514..ae1b23795786d2026a15f6119dccf5c402015789 100644
--- a/xfa/fxbarcode/oned/BC_OneDimWriter.cpp
+++ b/xfa/fxbarcode/oned/BC_OneDimWriter.cpp
@@ -290,6 +290,7 @@ void CBC_OneDimWriter::ShowChars(const CFX_WideStringC& contents,
}
FX_Free(pCharPos);
}
+
void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap*& pOutBitmap,
const CFX_WideStringC& contents,
int32_t& e) {
@@ -319,11 +320,10 @@ void CBC_OneDimWriter::RenderBitmapResult(CFX_DIBitmap*& pOutBitmap,
BC_EXCEPTION_CHECK_ReturnVoid(e);
}
CFX_DIBitmap* pStretchBitmap = pOutBitmap->StretchTo(m_Width, m_Height);
- if (pOutBitmap) {
- delete pOutBitmap;
- }
+ delete pOutBitmap;
pOutBitmap = pStretchBitmap;
}
+
void CBC_OneDimWriter::RenderDeviceResult(CFX_RenderDevice* device,
const CFX_Matrix* matrix,
const CFX_WideStringC& contents,
« no previous file with comments | « xfa/fxbarcode/common/reedsolomon/BC_ReedSolomonGF256.cpp ('k') | xfa/fxbarcode/pdf417/BC_PDF417.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698