[libpng16] Cosmetic change "ptr != 0" to "ptr != NULL" in png.c and pngrutil.c

This commit is contained in:
Glenn Randers-Pehrson 2016-10-16 14:34:40 -05:00
parent 01e99bbac1
commit a1312f7b19
2 changed files with 8 additions and 8 deletions

14
png.c
View File

@ -14,7 +14,7 @@
#include "pngpriv.h" #include "pngpriv.h"
/* Generate a compiler error if there is an old png.h in the search path. */ /* Generate a compiler error if there is an old png.h in the search path. */
typedef png_libpng_version_1_6_26rc01 Your_png_h_is_not_version_1_6_26rc01; typedef png_libpng_version_1_6_26rc02 Your_png_h_is_not_version_1_6_26rc02;
/* Tells libpng that we have already handled the first "num_bytes" bytes /* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another * of the PNG file signature. If the PNG data is embedded into another
@ -458,7 +458,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
#ifdef PNG_TEXT_SUPPORTED #ifdef PNG_TEXT_SUPPORTED
/* Free text item num or (if num == -1) all text items */ /* Free text item num or (if num == -1) all text items */
if (info_ptr->text != 0 && if (info_ptr->text != NULL &&
((mask & PNG_FREE_TEXT) & info_ptr->free_me) != 0) ((mask & PNG_FREE_TEXT) & info_ptr->free_me) != 0)
{ {
if (num != -1) if (num != -1)
@ -541,7 +541,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
#ifdef PNG_sPLT_SUPPORTED #ifdef PNG_sPLT_SUPPORTED
/* Free a given sPLT entry, or (if num == -1) all sPLT entries */ /* Free a given sPLT entry, or (if num == -1) all sPLT entries */
if (info_ptr->splt_palettes != 0 && if (info_ptr->splt_palettes != NULL &&
((mask & PNG_FREE_SPLT) & info_ptr->free_me) != 0) ((mask & PNG_FREE_SPLT) & info_ptr->free_me) != 0)
{ {
if (num != -1) if (num != -1)
@ -571,7 +571,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
#endif #endif
#ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED #ifdef PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED
if (info_ptr->unknown_chunks != 0 && if (info_ptr->unknown_chunks != NULL &&
((mask & PNG_FREE_UNKN) & info_ptr->free_me) != 0) ((mask & PNG_FREE_UNKN) & info_ptr->free_me) != 0)
{ {
if (num != -1) if (num != -1)
@ -617,7 +617,7 @@ png_free_data(png_const_structrp png_ptr, png_inforp info_ptr, png_uint_32 mask,
/* Free any image bits attached to the info structure */ /* Free any image bits attached to the info structure */
if (((mask & PNG_FREE_ROWS) & info_ptr->free_me) != 0) if (((mask & PNG_FREE_ROWS) & info_ptr->free_me) != 0)
{ {
if (info_ptr->row_pointers != 0) if (info_ptr->row_pointers != NULL)
{ {
png_uint_32 row; png_uint_32 row;
for (row = 0; row < info_ptr->height; row++) for (row = 0; row < info_ptr->height; row++)
@ -775,14 +775,14 @@ png_get_copyright(png_const_structrp png_ptr)
#else #else
# ifdef __STDC__ # ifdef __STDC__
return PNG_STRING_NEWLINE \ return PNG_STRING_NEWLINE \
"libpng version 1.6.26rc01 - October 12, 2016" PNG_STRING_NEWLINE \ "libpng version 1.6.26rc02 - October 16, 2016" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson" \ "Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \ PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \ "Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
PNG_STRING_NEWLINE; PNG_STRING_NEWLINE;
# else # else
return "libpng version 1.6.26rc01 - October 12, 2016\ return "libpng version 1.6.26rc02 - October 16, 2016\
Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson\ Copyright (c) 1998-2002,2004,2006-2016 Glenn Randers-Pehrson\
Copyright (c) 1996-1997 Andreas Dilger\ Copyright (c) 1996-1997 Andreas Dilger\
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc."; Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";

View File

@ -4523,7 +4523,7 @@ defined(PNG_USER_TRANSFORM_PTR_SUPPORTED)
* does not, so free the read buffer now regardless; the sequential reader * does not, so free the read buffer now regardless; the sequential reader
* reallocates it on demand. * reallocates it on demand.
*/ */
if (png_ptr->read_buffer != 0) if (png_ptr->read_buffer != NULL)
{ {
png_bytep buffer = png_ptr->read_buffer; png_bytep buffer = png_ptr->read_buffer;