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

Unified Diff: core/src/fxcodec/codec/fx_codec_jpeg.cpp

Issue 1297713003: Don't bother checking pointers before delete[] and FX_Free(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 5 years, 4 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 | « core/src/fxcodec/codec/fx_codec_jbig.cpp ('k') | core/src/fxcrt/fx_basic_buffer.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcodec/codec/fx_codec_jpeg.cpp
diff --git a/core/src/fxcodec/codec/fx_codec_jpeg.cpp b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
index 779e7f6b379d222b28c7c5cb4de5a14b2a4937d8..7e95bd358fd3c4e2c3be5ca2c3628b3cf6ca6909 100644
--- a/core/src/fxcodec/codec/fx_codec_jpeg.cpp
+++ b/core/src/fxcodec/codec/fx_codec_jpeg.cpp
@@ -221,9 +221,7 @@ static void _JpegEncode(const CFX_DIBSource* pSource,
}
jpeg_finish_compress(&cinfo);
jpeg_destroy_compress(&cinfo);
- if (line_buf) {
- FX_Free(line_buf);
- }
+ FX_Free(line_buf);
dest_size = dest_buf_length - (FX_STRSIZE)dest.free_in_buffer;
}
static FX_BOOL _JpegLoadInfo(const uint8_t* src_buf,
@@ -345,9 +343,7 @@ CCodec_JpegDecoder::~CCodec_JpegDecoder() {
m_pExtProvider->DestroyDecoder(m_pExtContext);
return;
}
- if (m_pScanlineBuf) {
- FX_Free(m_pScanlineBuf);
- }
+ FX_Free(m_pScanlineBuf);
if (m_bInited) {
jpeg_destroy_decompress(&cinfo);
}
« no previous file with comments | « core/src/fxcodec/codec/fx_codec_jbig.cpp ('k') | core/src/fxcrt/fx_basic_buffer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698