diff options
author | Lei Zhang <thestig@chromium.org> | 2016-02-22 20:32:21 -0800 |
---|---|---|
committer | Lei Zhang <thestig@chromium.org> | 2016-02-22 20:32:21 -0800 |
commit | 5eca305b1586b2107566a5c124baa5f2e00096c0 (patch) | |
tree | d2b6b17b62995b2249a28956a17ae87122f83124 /core/src/fxcodec/codec/fx_codec_png.cpp | |
parent | d2019df0a77c5d01a336f16be054d2f373e38c54 (diff) | |
download | pdfium-5eca305b1586b2107566a5c124baa5f2e00096c0.tar.xz |
Remove foo != NULL outside of xfa/
Most of these are from the XFA branch.
R=dsinclair@chromium.org
Review URL: https://codereview.chromium.org/1720043003 .
Diffstat (limited to 'core/src/fxcodec/codec/fx_codec_png.cpp')
-rw-r--r-- | core/src/fxcodec/codec/fx_codec_png.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/core/src/fxcodec/codec/fx_codec_png.cpp b/core/src/fxcodec/codec/fx_codec_png.cpp index 0df3455522..c8cb1b8a6a 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); } |