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

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

Issue 1720043003: Remove foo != NULL outside of xfa/ (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: rebase Created 4 years, 10 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_gif.cpp ('k') | core/src/fxcodec/codec/fx_codec_progress.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/src/fxcodec/codec/fx_codec_png.cpp
diff --git a/core/src/fxcodec/codec/fx_codec_png.cpp b/core/src/fxcodec/codec/fx_codec_png.cpp
index 0df34555229f6b24360fe1415c28c8a8da657308..c8cb1b8a6ab738168e8695512ca103b34439adbd 100644
--- a/core/src/fxcodec/codec/fx_codec_png.cpp
+++ b/core/src/fxcodec/codec/fx_codec_png.cpp
@@ -105,9 +105,7 @@ static void* _png_alloc_func(unsigned int size) {
return FX_Alloc(char, size);
}
static void _png_free_func(void* p) {
- if (p != NULL) {
- FX_Free(p);
- }
+ FX_Free(p);
}
};
static void _png_get_header_func(png_structp png_ptr, png_infop info_ptr) {
@@ -192,7 +190,7 @@ static void _png_get_row_func(png_structp png_ptr,
if (!pModule->AskScanlineBufCallback(p->child_ptr, row_num, src_buf)) {
png_error(png_ptr, "Ask Scanline buffer Callback Error");
}
- if (src_buf != NULL) {
+ if (src_buf) {
png_progressive_combine_row(png_ptr, src_buf, new_row);
}
pModule->FillScanlineBufCompletedCallback(p->child_ptr, pass, row_num);
@@ -220,7 +218,7 @@ void* CCodec_PngModule::Start(void* pModule) {
return NULL;
}
if (setjmp(png_jmpbuf(p->png_ptr))) {
- if (p != NULL) {
+ if (p) {
png_destroy_read_struct(&(p->png_ptr), &(p->info_ptr), (png_infopp)NULL);
FX_Free(p);
}
@@ -234,7 +232,7 @@ void* CCodec_PngModule::Start(void* pModule) {
}
void CCodec_PngModule::Finish(void* pContext) {
FXPNG_Context* p = (FXPNG_Context*)pContext;
- if (p != NULL) {
+ if (p) {
png_destroy_read_struct(&(p->png_ptr), &(p->info_ptr), (png_infopp)NULL);
p->m_FreeFunc(p);
}
« no previous file with comments | « core/src/fxcodec/codec/fx_codec_gif.cpp ('k') | core/src/fxcodec/codec/fx_codec_progress.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698