From 67806d44c18d6fdbfc28e499fc3eb156a8067f43 Mon Sep 17 00:00:00 2001 From: Glenn Randers-Pehrson Date: Wed, 29 Jul 2015 16:01:26 -0500 Subject: [PATCH] [libpng16] Imported from libpng-1.6.19beta01.tar --- LICENSE | 4 ++-- README | 2 +- contrib/pngminus/pnm2png.c | 29 ++++++++++++++++++++--------- libpng-manual.txt | 6 +++--- libpng.3 | 16 ++++++++-------- libpngpf.3 | 2 +- png.5 | 2 +- png.h | 10 +++++----- pngpriv.h | 4 ---- projects/vstudio/readme.txt | 2 +- projects/vstudio/zlib.props | 2 +- scripts/README.txt | 2 +- scripts/pnglibconf.dfa | 9 +-------- scripts/pnglibconf.h.prebuilt | 4 +--- 14 files changed, 46 insertions(+), 48 deletions(-) diff --git a/LICENSE b/LICENSE index 3c9af2f02..36fb838b2 100644 --- a/LICENSE +++ b/LICENSE @@ -10,7 +10,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.0.7, July 1, 2000, through 1.6.19beta01, July 24, 2015, are +libpng versions 1.0.7, July 1, 2000, through 1.6.19beta01, July 29, 2015, are Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.0.6 with the following individuals added to the list of Contributing Authors: @@ -104,4 +104,4 @@ the additional disclaimers inserted at version 1.0.7. Glenn Randers-Pehrson glennrp at users.sourceforge.net -July 24, 2015 +July 29, 2015 diff --git a/README b/README index d1e59f0b4..28ecdd9d1 100644 --- a/README +++ b/README @@ -1,4 +1,4 @@ -README for libpng version 1.6.19beta01 - July 24, 2015 (shared library 16.0) +README for libpng version 1.6.19beta01 - July 29, 2015 (shared library 16.0) See the note about version numbers near the top of png.h See INSTALL for instructions on how to install libpng. diff --git a/contrib/pngminus/pnm2png.c b/contrib/pngminus/pnm2png.c index 7bf720f68..8fa64cd1f 100644 --- a/contrib/pngminus/pnm2png.c +++ b/contrib/pngminus/pnm2png.c @@ -3,6 +3,7 @@ * copyright (C) 1999 by Willem van Schaik * * version 1.0 - 1999.10.15 - First version. + * version 1.1 - 2015.07.29 - Fixed leaks (Glenn Randers-Pehrson) * * Permission to use, copy, modify, and distribute this software and * its documentation for any purpose and without fee is hereby granted, @@ -200,17 +201,17 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, char width_token[16]; char height_token[16]; char maxval_token[16]; - volatile int color_type; + volatile int color_type=1; unsigned long ul_width=0, ul_alpha_width=0; unsigned long ul_height=0, ul_alpha_height=0; unsigned long ul_maxval=0; - volatile png_uint_32 width, height; - volatile png_uint_32 alpha_width, alpha_height; + volatile png_uint_32 width=0, height=0; + volatile png_uint_32 alpha_width=0, alpha_height=0; png_uint_32 maxval; volatile int bit_depth = 0; - int channels; + int channels=0; int alpha_depth = 0; - int alpha_present; + int alpha_present=0; int row, col; BOOL raw, alpha_raw = FALSE; #if defined(PNG_WRITE_INVERT_SUPPORTED) || defined(PNG_WRITE_PACK_SUPPORTED) @@ -356,8 +357,10 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, channels = 3; else if (color_type == PNG_COLOR_TYPE_RGB_ALPHA) channels = 4; +#if 0 else - channels = 0; /* should not happen */ + channels = 0; /* cannot happen */ +#endif alpha_present = (channels - 1) % 2; @@ -429,12 +432,16 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, NULL); if (!png_ptr) { + free (png_pixels); + png_pixels = NULL; return FALSE; } info_ptr = png_create_info_struct (png_ptr); if (!info_ptr) { png_destroy_write_struct (&png_ptr, (png_infopp) NULL); + free (png_pixels); + png_pixels = NULL; return FALSE; } @@ -449,7 +456,9 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, /* setjmp() must be called in every function that calls a PNG-reading libpng function */ if (setjmp (png_jmpbuf(png_ptr))) { - png_destroy_write_struct (&png_ptr, (png_infopp) NULL); + png_destroy_write_struct (&png_ptr, &info_ptr); + free (png_pixels); + png_pixels = NULL; return FALSE; } @@ -470,7 +479,9 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, if ((row_pointers = (png_byte **) malloc (height * sizeof (png_bytep))) == NULL) { - png_destroy_write_struct (&png_ptr, (png_infopp) NULL); + png_destroy_write_struct (&png_ptr, &info_ptr); + free (png_pixels); + png_pixels = NULL; return FALSE; } } @@ -486,7 +497,7 @@ BOOL pnm2png (FILE *pnm_file, FILE *png_file, FILE *alpha_file, BOOL interlace, png_write_end (png_ptr, info_ptr); /* clean up after the write, and free any memory allocated */ - png_destroy_write_struct (&png_ptr, (png_infopp) NULL); + png_destroy_write_struct (&png_ptr, &info_ptr); if (row_pointers != (unsigned char**) NULL) free (row_pointers); diff --git a/libpng-manual.txt b/libpng-manual.txt index f8a9cbc28..84e801936 100644 --- a/libpng-manual.txt +++ b/libpng-manual.txt @@ -1,6 +1,6 @@ libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.6.19beta01 - July 25, 2015 + libpng version 1.6.19beta01 - July 29, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -11,7 +11,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.6.19beta01 - July 25, 2015 + libpng versions 0.97, January 1998, through 1.6.19beta01 - July 29, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -5304,7 +5304,7 @@ Other rules can be inferred by inspecting the libpng source. XVI. Y2K Compliance in libpng -July 25, 2015 +July 29, 2015 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. diff --git a/libpng.3 b/libpng.3 index 719a73d62..90b9b7dd4 100644 --- a/libpng.3 +++ b/libpng.3 @@ -1,4 +1,4 @@ -.TH LIBPNG 3 "July 25, 2015" +.TH LIBPNG 3 "July 29, 2015" .SH NAME libpng \- Portable Network Graphics (PNG) Reference Library 1.6.19beta01 .SH SYNOPSIS @@ -508,7 +508,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng. .SH LIBPNG.TXT libpng-manual.txt - A description on how to use and modify libpng - libpng version 1.6.19beta01 - July 25, 2015 + libpng version 1.6.19beta01 - July 29, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -519,7 +519,7 @@ libpng-manual.txt - A description on how to use and modify libpng Based on: - libpng versions 0.97, January 1998, through 1.6.19beta01 - July 25, 2015 + libpng versions 0.97, January 1998, through 1.6.19beta01 - July 29, 2015 Updated and distributed by Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson @@ -5812,7 +5812,7 @@ Other rules can be inferred by inspecting the libpng source. .SH XVI. Y2K Compliance in libpng -July 25, 2015 +July 29, 2015 Since the PNG Development group is an ad-hoc body, we can't make an official declaration. @@ -6042,7 +6042,7 @@ the first widely used release: 1.6.5 16 10605 16.so.16.5[.0] 1.6.6 16 10606 16.so.16.6[.0] 1.6.7beta01-04 16 10607 16.so.16.7[.0] - 1.6.7rc01-02 16 10607 16.so.16.7[.0] + 1.6.7rc01-03 16 10607 16.so.16.7[.0] 1.6.7 16 10607 16.so.16.7[.0] 1.6.8beta01-02 16 10608 16.so.16.8[.0] 1.6.8rc01-02 16 10608 16.so.16.8[.0] @@ -6133,7 +6133,7 @@ possible without all of you. Thanks to Frank J. T. Wojcik for helping with the documentation. -Libpng version 1.6.19beta01 - July 25, 2015: +Libpng version 1.6.19beta01 - July 29, 2015: Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). @@ -6156,7 +6156,7 @@ this sentence. This code is released under the libpng license. -libpng versions 1.0.7, July 1, 2000, through 1.6.19beta01, July 25, 2015, are +libpng versions 1.0.7, July 1, 2000, through 1.6.19beta01, July 29, 2015, are Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, and are distributed according to the same disclaimer and license as libpng-1.0.6 with the following individuals added to the list of Contributing Authors: @@ -6250,7 +6250,7 @@ the additional disclaimers inserted at version 1.0.7. Glenn Randers-Pehrson glennrp at users.sourceforge.net -July 25, 2015 +July 29, 2015 .\" end of man page diff --git a/libpngpf.3 b/libpngpf.3 index 9397bec4d..e3f8ce0bc 100644 --- a/libpngpf.3 +++ b/libpngpf.3 @@ -1,4 +1,4 @@ -.TH LIBPNGPF 3 "July 24, 2015" +.TH LIBPNGPF 3 "July 29, 2015" .SH NAME libpng \- Portable Network Graphics (PNG) Reference Library 1.6.19beta01 (private functions) diff --git a/png.5 b/png.5 index 2107544a1..40a7a5ada 100644 --- a/png.5 +++ b/png.5 @@ -1,4 +1,4 @@ -.TH PNG 5 "July 24, 2015" +.TH PNG 5 "July 29, 2015" .SH NAME png \- Portable Network Graphics (PNG) format .SH DESCRIPTION diff --git a/png.h b/png.h index 29961c51f..678a59a9f 100644 --- a/png.h +++ b/png.h @@ -1,7 +1,7 @@ /* png.h - header file for PNG reference library * - * libpng version 1.6.19beta01, July 26, 2015 + * libpng version 1.6.19beta01, July 29, 2015 * * Copyright (c) 1998-2015 Glenn Randers-Pehrson * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) @@ -12,7 +12,7 @@ * Authors and maintainers: * libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger - * libpng versions 0.97, January 1998, through 1.6.19beta01, July 26, 2015: Glenn + * libpng versions 0.97, January 1998, through 1.6.19beta01, July 29, 2015: Glenn * See also "Contributing Authors", below. * * Note about libpng version numbers: @@ -251,7 +251,7 @@ * * This code is released under the libpng license. * - * libpng versions 1.0.7, July 1, 2000, through 1.6.19beta01, July 26, 2015, are + * libpng versions 1.0.7, July 1, 2000, through 1.6.19beta01, July 29, 2015, are * Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, and are * distributed according to the same disclaimer and license as libpng-1.0.6 * with the following individuals added to the list of Contributing Authors: @@ -360,7 +360,7 @@ * Y2K compliance in libpng: * ========================= * - * July 26, 2015 + * July 29, 2015 * * Since the PNG Development group is an ad-hoc body, we can't make * an official declaration. @@ -430,7 +430,7 @@ /* Version information for png.h - this should match the version in png.c */ #define PNG_LIBPNG_VER_STRING "1.6.19beta01" #define PNG_HEADER_VERSION_STRING \ - " libpng version 1.6.19beta01 - July 26, 2015\n" + " libpng version 1.6.19beta01 - July 29, 2015\n" #define PNG_LIBPNG_VER_SONUM 16 #define PNG_LIBPNG_VER_DLLNUM 16 diff --git a/pngpriv.h b/pngpriv.h index 199750328..761d4ad80 100644 --- a/pngpriv.h +++ b/pngpriv.h @@ -575,10 +575,6 @@ #define PNG_STRUCT_PNG 0x0001 #define PNG_STRUCT_INFO 0x0002 -/* Scaling factor for filter heuristic weighting calculations */ -#define PNG_WEIGHT_FACTOR (1<<(PNG_WEIGHT_SHIFT)) -#define PNG_COST_FACTOR (1<<(PNG_COST_SHIFT)) - /* Flags for the png_ptr->flags rather than declaring a byte for each one */ #define PNG_FLAG_ZLIB_CUSTOM_STRATEGY 0x0001 #define PNG_FLAG_ZSTREAM_INITIALIZED 0x0002 /* Added to libpng-1.6.0 */ diff --git a/projects/vstudio/readme.txt b/projects/vstudio/readme.txt index bf6b91e27..67da6c882 100644 --- a/projects/vstudio/readme.txt +++ b/projects/vstudio/readme.txt @@ -1,7 +1,7 @@ VisualStudio instructions -libpng version 1.6.19beta01 - July 24, 2015 +libpng version 1.6.19beta01 - July 29, 2015 Copyright (c) 1998-2010 Glenn Randers-Pehrson diff --git a/projects/vstudio/zlib.props b/projects/vstudio/zlib.props index f3d2b4dec..15e5c1f09 100644 --- a/projects/vstudio/zlib.props +++ b/projects/vstudio/zlib.props @@ -2,7 +2,7 @@