[libpng17] Fixed makepng.c so that it compiles with GCC 5.1.0.

Added contrib/testspngs/: a directory for additional test png files
This commit is contained in:
John Bowler 2015-09-18 16:22:38 -05:00 committed by Glenn Randers-Pehrson
parent f8d3e854cb
commit 38647d4b21
32 changed files with 177 additions and 96 deletions

View File

@ -882,6 +882,9 @@ Version 1.7.0beta66 [September 18, 2015]
not required at present but it may prevent a bug being introduced in not required at present but it may prevent a bug being introduced in
the future. the future.
Fixed some new Coverity defects that were introduced in 1.7.0beta65. Fixed some new Coverity defects that were introduced in 1.7.0beta65.
Fixed makepng.c so that it compiles with GCC 5.1.0.
Added contrib/testspngs/: a directory for additional test png files
generated by makepng.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -5179,6 +5179,9 @@ Version 1.7.0beta66 [September 18, 2015]
not required at present but it may prevent a bug being introduced in not required at present but it may prevent a bug being introduced in
the future. the future.
Fixed some new Coverity defects that were introduced in 1.7.0beta65. Fixed some new Coverity defects that were introduced in 1.7.0beta65.
Fixed makepng.c so that it compiles with GCC 5.1.0.
Added contrib/testspngs/: a directory for additional test png files
generated by makepng.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit (subscription required; visit

View File

@ -261,7 +261,7 @@ endif(NOT WIN32 OR CYGWIN OR MINGW)
# SET UP LINKS # SET UP LINKS
if(PNG_SHARED) if(PNG_SHARED)
set_target_properties(${PNG_LIB_NAME} PROPERTIES set_target_properties(${PNG_LIB_NAME} PROPERTIES
# VERSION 17.${PNGLIB_RELEASE}.1.7.0beta65 # VERSION 17.${PNGLIB_RELEASE}.1.7.0beta66
VERSION 17.${PNGLIB_RELEASE}.0 VERSION 17.${PNGLIB_RELEASE}.0
SOVERSION 17 SOVERSION 17
CLEAN_DIRECT_OUTPUT 1) CLEAN_DIRECT_OUTPUT 1)

View File

@ -10,7 +10,7 @@ this sentence.
This code is released under the libpng license. This code is released under the libpng license.
libpng versions 1.0.7, July 1, 2000, through 1.7.0beta65, September 16, 2015, are libpng versions 1.0.7, July 1, 2000, through 1.7.0beta66, September 18, 2015, are
Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, and 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 distributed according to the same disclaimer and license as libpng-1.0.6
with the following individuals added to the list of Contributing Authors: 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 Glenn Randers-Pehrson
glennrp at users.sourceforge.net glennrp at users.sourceforge.net
September 16, 2015 September 18, 2015

2
README
View File

@ -1,4 +1,4 @@
README for libpng version 1.7.0beta65 - September 16, 2015 (shared library 17.0) README for libpng version 1.7.0beta66 - September 18, 2015 (shared library 17.0)
See the note about version numbers near the top of png.h See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng. See INSTALL for instructions on how to install libpng.

View File

@ -18,7 +18,7 @@ AC_PREREQ([2.68])
dnl Version number stuff here: dnl Version number stuff here:
AC_INIT([libpng],[1.7.0beta65],[png-mng-implement@lists.sourceforge.net]) AC_INIT([libpng],[1.7.0beta66],[png-mng-implement@lists.sourceforge.net])
AC_CONFIG_MACRO_DIR([scripts]) AC_CONFIG_MACRO_DIR([scripts])
# libpng does not follow GNU file name conventions (hence 'foreign') # libpng does not follow GNU file name conventions (hence 'foreign')
@ -40,7 +40,7 @@ dnl automake, so the following is not necessary (and is not defined anyway):
dnl AM_PREREQ([1.11.2]) dnl AM_PREREQ([1.11.2])
dnl stop configure from automagically running automake dnl stop configure from automagically running automake
PNGLIB_VERSION=1.7.0beta65 PNGLIB_VERSION=1.7.0beta66
PNGLIB_MAJOR=1 PNGLIB_MAJOR=1
PNGLIB_MINOR=7 PNGLIB_MINOR=7
PNGLIB_RELEASE=0 PNGLIB_RELEASE=0

View File

@ -82,6 +82,7 @@
#include <ctype.h> #include <ctype.h>
#include <math.h> #include <math.h>
#include <errno.h> #include <errno.h>
#include <stdint.h>
#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H) #if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
# include <config.h> # include <config.h>
@ -96,6 +97,23 @@
# include "../../png.h" # include "../../png.h"
#endif #endif
/* Work round for GCC complaints about casting a (double) function result to
* an unsigned:
*/
static unsigned int
flooru(double d)
{
d = floor(d);
return (unsigned int)d;
}
static png_byte
floorb(double d)
{
d = floor(d);
return (png_byte)d;
}
/* This structure is used for inserting extra chunks (the --insert argument, not /* This structure is used for inserting extra chunks (the --insert argument, not
* documented above.) * documented above.)
*/ */
@ -217,7 +235,8 @@ generate_palette(png_colorp palette, png_bytep trans, int bit_depth,
else else
{ {
unsigned int size = 1U << (bit_depth/2); /* 2, 4 or 16 */ unsigned int size = 1U << (bit_depth/2); /* 2, 4 or 16 */
unsigned int x, y, ip; unsigned int x, y;
volatile unsigned int ip = 0;
for (x=0; x<size; ++x) for (y=0; y<size; ++y) for (x=0; x<size; ++x) for (y=0; y<size; ++y)
{ {
@ -281,7 +300,7 @@ set_value(png_bytep row, size_t rowbytes, png_uint_32 x, unsigned int bit_depth,
exit(1); exit(1);
case 16: case 16:
value = (unsigned int)floor(65535*pow(value/65535.,conv)+.5); value = flooru(65535*pow(value/65535.,conv)+.5);
*row++ = (png_byte)(value >> 8); *row++ = (png_byte)(value >> 8);
*row = (png_byte)value; *row = (png_byte)value;
return; return;
@ -625,7 +644,7 @@ write_png(const char **name, FILE *fp, int color_type, int bit_depth,
gamma_table[0] = 0; gamma_table[0] = 0;
for (i=1; i<255; ++i) for (i=1; i<255; ++i)
gamma_table[i] = (png_byte)floor(pow(i/255.,conv) * 255 + .5); gamma_table[i] = floorb(pow(i/255.,conv) * 255 + .5);
gamma_table[255] = 255; gamma_table[255] = 255;
} }
@ -831,7 +850,7 @@ static png_size_t
load_fake(png_charp param, png_bytepp profile) load_fake(png_charp param, png_bytepp profile)
{ {
char *endptr = NULL; char *endptr = NULL;
unsigned long long int size = strtoull(param, &endptr, 0/*base*/); uint64_t size = strtoull(param, &endptr, 0/*base*/);
/* The 'fake' format is <number>*[string] */ /* The 'fake' format is <number>*[string] */
if (endptr != NULL && *endptr == '*') if (endptr != NULL && *endptr == '*')

72
contrib/testpngs/makepngs.sh Executable file
View File

@ -0,0 +1,72 @@
#!/bin/sh
#
# Make a set of test PNG files, MAKEPNG is the name of the makepng executable
# built from contrib/libtests/makepng.c
#
# The arguments say whether to build all the files or whether just to build the
# ones that extend the code-coverage of libpng from the existing test files in
# contrib/pngsuite.
test -n "$MAKEPNG" || MAKEPNG=./makepng
mp(){
${MAKEPNG} $1 "$3" "$4" "$2$3-$4.png"
}
mpg(){
if test "$g" = "none"
then
mp "" "" "$2" "$3"
else
mp "--$1" "$1-" "$2" "$3"
fi
}
case "$1" in
--all)
for g in none sRGB linear 1.8
do
for c in gray palette
do
for b in 1 2 4
do
mpg "$g" "$c" "$b"
done
done
mpg "$g" palette 8
for c in gray gray-alpha rgb rgb-alpha
do
for b in 8 16
do
mpg "$g" "$c" "$b"
done
done
done;;
--coverage)
# Comments below indicate cases known to be required and not duplicated
# in other (required) cases; the aim is to get a minimal set that gives
# the maxium code coverage.
mpg none gray 16
mpg none gray-alpha 16
mpg none gray-alpha 8 # required
mpg none palette 8
mpg none rgb-alpha 8
mpg 1.8 gray 2
mpg 1.8 palette 2 # required
mpg 1.8 palette 4 # required
mpg 1.8 palette 8
mpg linear palette 8
mpg linear rgb-alpha 16
mpg sRGB gray-alpha 8
mpg sRGB palette 1 # required
mpg sRGB palette 8
mpg sRGB rgb-alpha 16 # required pngread.c:2422 untested
mpg sRGB rgb-alpha 8;;
*)
echo "$0 $1: unknown argument, usage:" >&2
echo " $0 [--all|--coverage" >&2
exit 1
esac

View File

@ -1,6 +1,6 @@
libpng-manual.txt - A description on how to use and modify libpng libpng-manual.txt - A description on how to use and modify libpng
libpng version 1.7.0beta65 - September 16, 2015 libpng version 1.7.0beta66 - September 18, 2015
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net> <glennrp at users.sourceforge.net>
Copyright (c) 1998-2015 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: Based on:
libpng versions 0.97, January 1998, through 1.7.0beta65 - September 16, 2015 libpng versions 0.97, January 1998, through 1.7.0beta66 - September 18, 2015
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2015 Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson
@ -5317,13 +5317,13 @@ Other rules can be inferred by inspecting the libpng source.
XVII. Y2K Compliance in libpng XVII. Y2K Compliance in libpng
September 16, 2015 September 18, 2015
Since the PNG Development group is an ad-hoc body, we can't make Since the PNG Development group is an ad-hoc body, we can't make
an official declaration. an official declaration.
This is your unofficial assurance that libpng from version 0.71 and This is your unofficial assurance that libpng from version 0.71 and
upward through 1.7.0beta65 are Y2K compliant. It is my belief that earlier upward through 1.7.0beta66 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant. versions were also Y2K compliant.
Libpng only has two year fields. One is a 2-byte unsigned integer Libpng only has two year fields. One is a 2-byte unsigned integer

View File

@ -1,6 +1,6 @@
.TH LIBPNG 3 "September 16, 2015" .TH LIBPNG 3 "September 18, 2015"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.7.0beta65 libpng \- Portable Network Graphics (PNG) Reference Library 1.7.0beta66
.SH SYNOPSIS .SH SYNOPSIS
\fB \fB
#include <png.h>\fP #include <png.h>\fP
@ -498,7 +498,7 @@ Following is a copy of the libpng-manual.txt file that accompanies libpng.
.SH LIBPNG.TXT .SH LIBPNG.TXT
libpng-manual.txt - A description on how to use and modify libpng libpng-manual.txt - A description on how to use and modify libpng
libpng version 1.7.0beta65 - September 16, 2015 libpng version 1.7.0beta66 - September 18, 2015
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
<glennrp at users.sourceforge.net> <glennrp at users.sourceforge.net>
Copyright (c) 1998-2015 Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson
@ -509,7 +509,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on: Based on:
libpng versions 0.97, January 1998, through 1.7.0beta65 - September 16, 2015 libpng versions 0.97, January 1998, through 1.7.0beta66 - September 18, 2015
Updated and distributed by Glenn Randers-Pehrson Updated and distributed by Glenn Randers-Pehrson
Copyright (c) 1998-2015 Glenn Randers-Pehrson Copyright (c) 1998-2015 Glenn Randers-Pehrson
@ -5815,13 +5815,13 @@ Other rules can be inferred by inspecting the libpng source.
.SH XVII. Y2K Compliance in libpng .SH XVII. Y2K Compliance in libpng
September 16, 2015 September 18, 2015
Since the PNG Development group is an ad-hoc body, we can't make Since the PNG Development group is an ad-hoc body, we can't make
an official declaration. an official declaration.
This is your unofficial assurance that libpng from version 0.71 and This is your unofficial assurance that libpng from version 0.71 and
upward through 1.7.0beta65 are Y2K compliant. It is my belief that earlier upward through 1.7.0beta66 are Y2K compliant. It is my belief that earlier
versions were also Y2K compliant. versions were also Y2K compliant.
Libpng only has two year fields. One is a 2-byte unsigned integer Libpng only has two year fields. One is a 2-byte unsigned integer
@ -6080,7 +6080,7 @@ the first widely used release:
1.6.18 16 10618 16.so.16.18[.0] 1.6.18 16 10618 16.so.16.18[.0]
1.6.19beta01 16 10619 16.so.16.19[.0] 1.6.19beta01 16 10619 16.so.16.19[.0]
1.7.0alpha01-10 17 10700 17.so.17.0[.0] 1.7.0alpha01-10 17 10700 17.so.17.0[.0]
1.7.0beta01-65 17 10700 17.so.17.0[.0] 1.7.0beta01-66 17 10700 17.so.17.0[.0]
Henceforth the source version will match the shared-library minor Henceforth the source version will match the shared-library minor
and patch numbers; the shared-library major version number will be and patch numbers; the shared-library major version number will be
@ -6137,7 +6137,7 @@ possible without all of you.
Thanks to Frank J. T. Wojcik for helping with the documentation. Thanks to Frank J. T. Wojcik for helping with the documentation.
Libpng version 1.7.0beta65 - September 16, 2015: Libpng version 1.7.0beta66 - September 18, 2015:
Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc. Initially created in 1995 by Guy Eric Schalnat, then of Group 42, Inc.
Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net). Currently maintained by Glenn Randers-Pehrson (glennrp at users.sourceforge.net).
@ -6160,7 +6160,7 @@ this sentence.
This code is released under the libpng license. This code is released under the libpng license.
libpng versions 1.0.7, July 1, 2000, through 1.7.0beta65, September 16, 2015, are libpng versions 1.0.7, July 1, 2000, through 1.7.0beta66, September 18, 2015, are
Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, and 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 distributed according to the same disclaimer and license as libpng-1.0.6
with the following individuals added to the list of Contributing Authors: with the following individuals added to the list of Contributing Authors:
@ -6254,7 +6254,7 @@ the additional disclaimers inserted at version 1.0.7.
Glenn Randers-Pehrson Glenn Randers-Pehrson
glennrp at users.sourceforge.net glennrp at users.sourceforge.net
September 16, 2015 September 18, 2015
.\" end of man page .\" end of man page

View File

@ -1,6 +1,6 @@
.TH LIBPNGPF 3 "September 16, 2015" .TH LIBPNGPF 3 "September 18, 2015"
.SH NAME .SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.7.0beta65 libpng \- Portable Network Graphics (PNG) Reference Library 1.7.0beta66
(private functions) (private functions)
.SH SYNOPSIS .SH SYNOPSIS
\fB#include \fI"pngpriv.h" \fB#include \fI"pngpriv.h"

2
png.5
View File

@ -1,4 +1,4 @@
.TH PNG 5 "September 16, 2015" .TH PNG 5 "September 18, 2015"
.SH NAME .SH NAME
png \- Portable Network Graphics (PNG) format png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION .SH DESCRIPTION

11
png.c
View File

@ -15,7 +15,7 @@
#define PNG_SRC_FILE PNG_SRC_FILE_png #define PNG_SRC_FILE PNG_SRC_FILE_png
/* 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_7_0beta65 Your_png_h_is_not_version_1_7_0beta65; typedef png_libpng_version_1_7_0beta66 Your_png_h_is_not_version_1_7_0beta66;
/* 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
@ -141,10 +141,9 @@ png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, png_size_t length)
do do
{ {
uInt safe_length = (uInt)length; uInt safe_length = (uInt)length;
#ifndef __COVERITY__
if (safe_length == 0) if (safe_length == 0)
safe_length = (uInt)-1; /* evil, but safe */ safe_length = ZLIB_IO_MAX;
#endif
crc = crc32(crc, ptr, safe_length); crc = crc32(crc, ptr, safe_length);
@ -694,13 +693,13 @@ 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.7.0beta65 - September 16, 2015" PNG_STRING_NEWLINE \ "libpng version 1.7.0beta66 - September 18, 2015" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2015 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2015 Glenn Randers-Pehrson" 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.7.0beta65 - September 16, 2015\ return "libpng version 1.7.0beta66 - September 18, 2015\
Copyright (c) 1998-2015 Glenn Randers-Pehrson\ Copyright (c) 1998-2015 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.";

20
png.h
View File

@ -1,7 +1,7 @@
/* png.h - header file for PNG reference library /* png.h - header file for PNG reference library
* *
* libpng version 1.7.0beta65, September 16, 2015 * libpng version 1.7.0beta66, September 18, 2015
* *
* Copyright (c) 1998-2015 Glenn Randers-Pehrson * Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
@ -12,7 +12,7 @@
* Authors and maintainers: * Authors and maintainers:
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat * 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.89, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.7.0beta65, September 16, 2015: Glenn * libpng versions 0.97, January 1998, through 1.7.0beta66, September 18, 2015: Glenn
* See also "Contributing Authors", below. * See also "Contributing Authors", below.
* *
* Note about libpng version numbers: * Note about libpng version numbers:
@ -220,7 +220,7 @@
* 1.6.18rc01-03 16 10618 16.so.16.18[.0] * 1.6.18rc01-03 16 10618 16.so.16.18[.0]
* 1.6.18 16 10618 16.so.16.18[.0] * 1.6.18 16 10618 16.so.16.18[.0]
* 1.7.0alpha01-10 17 10700 17.so.17.0[.0] * 1.7.0alpha01-10 17 10700 17.so.17.0[.0]
* 1.7.0beta01-65 17 10700 17.so.17.0[.0] * 1.7.0beta01-66 17 10700 17.so.17.0[.0]
* *
* Henceforth the source version will match the shared-library major * Henceforth the source version will match the shared-library major
* and minor numbers; the shared-library major version number will be * and minor numbers; the shared-library major version number will be
@ -252,7 +252,7 @@
* *
* This code is released under the libpng license. * This code is released under the libpng license.
* *
* libpng versions 1.0.7, July 1, 2000, through 1.7.0beta65, September 16, 2015, are * libpng versions 1.0.7, July 1, 2000, through 1.7.0beta66, September 18, 2015, are
* Copyright (c) 2000-2002, 2004, 2006-2015 Glenn Randers-Pehrson, and 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 * distributed according to the same disclaimer and license as libpng-1.0.6
* with the following individuals added to the list of Contributing Authors: * with the following individuals added to the list of Contributing Authors:
@ -361,13 +361,13 @@
* Y2K compliance in libpng: * Y2K compliance in libpng:
* ========================= * =========================
* *
* September 16, 2015 * September 18, 2015
* *
* Since the PNG Development group is an ad-hoc body, we can't make * Since the PNG Development group is an ad-hoc body, we can't make
* an official declaration. * an official declaration.
* *
* This is your unofficial assurance that libpng from version 0.71 and * This is your unofficial assurance that libpng from version 0.71 and
* upward through 1.7.0beta65 are Y2K compliant. It is my belief that * upward through 1.7.0beta66 are Y2K compliant. It is my belief that
* earlier versions were also Y2K compliant. * earlier versions were also Y2K compliant.
* *
* Libpng only has two year fields. One is a 2-byte unsigned integer * Libpng only has two year fields. One is a 2-byte unsigned integer
@ -429,9 +429,9 @@
*/ */
/* Version information for png.h - this should match the version in png.c */ /* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.7.0beta65" #define PNG_LIBPNG_VER_STRING "1.7.0beta66"
#define PNG_HEADER_VERSION_STRING \ #define PNG_HEADER_VERSION_STRING \
" libpng version 1.7.0beta65 - September 16, 2015\n" " libpng version 1.7.0beta66 - September 18, 2015\n"
#define PNG_LIBPNG_VER_SONUM 17 #define PNG_LIBPNG_VER_SONUM 17
#define PNG_LIBPNG_VER_DLLNUM 17 #define PNG_LIBPNG_VER_DLLNUM 17
@ -445,7 +445,7 @@
* PNG_LIBPNG_VER_STRING, omitting any leading zero: * PNG_LIBPNG_VER_STRING, omitting any leading zero:
*/ */
#define PNG_LIBPNG_VER_BUILD 65 #define PNG_LIBPNG_VER_BUILD 66
/* Release Status */ /* Release Status */
#define PNG_LIBPNG_BUILD_ALPHA 1 #define PNG_LIBPNG_BUILD_ALPHA 1
@ -705,7 +705,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h /* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number. * do not agree upon the version number.
*/ */
typedef char* png_libpng_version_1_7_0beta65; typedef char* png_libpng_version_1_7_0beta66;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. /* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
* *

View File

@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng /* pngconf.h - machine configurable file for libpng
* *
* libpng version 1.7.0beta65, September 16, 2015 * libpng version 1.7.0beta66, September 18, 2015
* *
* Copyright (c) 1998-2015 Glenn Randers-Pehrson * Copyright (c) 1998-2015 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -2109,14 +2109,11 @@ png_image_read_colormap(png_voidp argument)
output_processing = PNG_CMAP_NONE; output_processing = PNG_CMAP_NONE;
break; break;
} }
#ifdef __COVERITY__ /* Coverity claims that output_encoding cannot be 2 (P_LINEAR)
/* Coverity claims that output_encoding cannot be 2 (P_LINEAR) * here.
* here. */
*/ affirm(output_encoding != P_LINEAR);
back_alpha = 255; back_alpha = 255U;
#else
back_alpha = output_encoding == P_LINEAR ? 65535 : 255;
#endif
} }
/* output_processing means that the libpng-processed row will be /* output_processing means that the libpng-processed row will be
@ -2238,17 +2235,13 @@ png_image_read_colormap(png_voidp argument)
/* NOTE: this preserves the full precision of the application /* NOTE: this preserves the full precision of the application
* background color. * background color.
*
* Coverity claims that output_encoding cannot be 2 (P_LINEAR)
*/ */
affirm(output_encoding != P_LINEAR);
background_index = i; background_index = i;
png_create_colormap_entry(display, i++, back_r, back_g, back_b, png_create_colormap_entry(display, i++, back_r, back_g, back_b,
#ifdef __COVERITY__ 255U, output_encoding);
/* Coverity claims that output_encoding cannot be 2 (P_LINEAR)
* here.
*/ 255U,
#else
output_encoding == P_LINEAR ? 65535U : 255U,
#endif
output_encoding);
/* For non-opaque input composite on the sRGB background - this /* For non-opaque input composite on the sRGB background - this
* requires inverting the encoding for each component. The input * requires inverting the encoding for each component. The input

View File

@ -897,10 +897,8 @@ png_do_expand_lbd_gray(png_transformp *transform, png_transform_controlp tc)
/* This helps avoid cluttering the code up with #ifdefs: */ /* This helps avoid cluttering the code up with #ifdefs: */
# define check_tRNS if (do_alpha) *--dp = (pixel != gray) * 255U; # define check_tRNS if (do_alpha) *--dp = (pixel != gray) * 255U;
# define UNTESTED_tRNS if (do_alpha) UNTESTED
# else /* !READ_tRNS */ # else /* !READ_tRNS */
# define check_tRNS # define check_tRNS
# define UNTESTED_tRNS
# endif /* READ_tRNS */ # endif /* READ_tRNS */
dp += PNG_TC_ROWBYTES(*tc); /* pre-decremented below */ dp += PNG_TC_ROWBYTES(*tc); /* pre-decremented below */
@ -4986,10 +4984,7 @@ png_do_background_alpha_RGBA(png_transformp *transform,
case 65535U: /* opaque */ case 65535U: /* opaque */
if (copy) if (copy)
{
memcpy(dp, sp, 8U); memcpy(dp, sp, 8U);
UNTESTED
}
break; break;
} }
@ -5303,12 +5298,9 @@ png_init_background(png_transformp *transform, png_transform_controlp tc)
*/ */
if ((tc->format & PNG_FORMAT_FLAG_ALPHA) != 0) if ((tc->format & PNG_FORMAT_FLAG_ALPHA) != 0)
{ {
/* TODO: it may be impossible to get here! */
affirm(tc->transparent_alpha); affirm(tc->transparent_alpha);
/* This init routine does the sBIT handling: */ /* This init routine does the sBIT handling: */
UNTESTED
png_init_background_transparent(transform, tc); png_init_background_transparent(transform, tc);
UNTESTED
} }
else if (!tc->palette && png_ptr->num_trans == 1 && else if (!tc->palette && png_ptr->num_trans == 1 &&

View File

@ -1402,11 +1402,6 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr)
else if (size > 0) else if (size > 0)
errmsg = "truncated"; errmsg = "truncated";
#ifndef __COVERITY__
else
errmsg = png_ptr->zstream.msg;
#endif
} }
/* else png_icc_check_tag_table output an error */ /* else png_icc_check_tag_table output an error */

View File

@ -1537,7 +1537,7 @@ png_set_compression_buffer_size(png_structrp png_ptr, png_size_t size)
png_ptr->IDAT_read_size = (png_uint_32)size; /* checked above */ png_ptr->IDAT_read_size = (png_uint_32)size; /* checked above */
return; return;
} }
# endif # endif /* SEQUENTIAL_READ */
# ifdef PNG_WRITE_SUPPORTED # ifdef PNG_WRITE_SUPPORTED
if (!png_ptr->read_struct) if (!png_ptr->read_struct)
@ -1550,9 +1550,8 @@ png_set_compression_buffer_size(png_structrp png_ptr, png_size_t size)
return; return;
} }
#ifndef __COVERITY__ /* NOTE: size is limited to 0..PNG_UINT_31_MAX (2^31-1) at this point,
/* Some compilers complain that this is always false. However, it * however ZLIB_IO_MAX may be smaller (for example on a 16-bit system).
* can be true when integer overflow happens.
*/ */
if (size > ZLIB_IO_MAX) if (size > ZLIB_IO_MAX)
{ {
@ -1560,7 +1559,6 @@ png_set_compression_buffer_size(png_structrp png_ptr, png_size_t size)
"Compression buffer size limited to system maximum"); "Compression buffer size limited to system maximum");
size = ZLIB_IO_MAX; /* must fit */ size = ZLIB_IO_MAX; /* must fit */
} }
#endif
if (size < 6) if (size < 6)
{ {
@ -1579,7 +1577,7 @@ png_set_compression_buffer_size(png_structrp png_ptr, png_size_t size)
png_ptr->zbuffer_size = (uInt)size; png_ptr->zbuffer_size = (uInt)size;
} }
} }
# endif # endif /* WRITE */
} }
void PNGAPI void PNGAPI

View File

@ -55,7 +55,11 @@
* even improve performance on some systems (and degrade it on others.) * even improve performance on some systems (and degrade it on others.)
*/ */
#ifndef ZLIB_IO_MAX #ifndef ZLIB_IO_MAX
# define ZLIB_IO_MAX ((uInt)-1) # ifdef __COVERITY__
# define ZLIB_IO_MAX ((uInt)255U) /* else COVERITY whines */
# else
# define ZLIB_IO_MAX ((uInt)-1)
# endif /* COVERITY */
#endif #endif
#ifdef PNG_WRITE_SUPPORTED #ifdef PNG_WRITE_SUPPORTED

View File

@ -1071,6 +1071,9 @@ test_one_file(PNG_CONST char *inname, PNG_CONST char *outname)
/*NOT REACHED*/ /*NOT REACHED*/
} }
} }
else
png_error(read_ptr, "png_get_IHDR failed");
} }
#ifdef PNG_FIXED_POINT_SUPPORTED #ifdef PNG_FIXED_POINT_SUPPORTED
#ifdef PNG_cHRM_SUPPORTED #ifdef PNG_cHRM_SUPPORTED

View File

@ -1,7 +1,7 @@
VisualStudio instructions VisualStudio instructions
libpng version 1.7.0beta65 - September 16, 2015 libpng version 1.7.0beta66 - September 18, 2015
Copyright (c) 1998-2010 Glenn Randers-Pehrson Copyright (c) 1998-2010 Glenn Randers-Pehrson

View File

@ -2,7 +2,7 @@
<!-- <!--
* zlib.props - location of zlib source * zlib.props - location of zlib source
* *
* libpng version 1.7.0beta65 - September 16, 2015 * libpng version 1.7.0beta66 - September 18, 2015
* *
* Copyright (c) 1998-2011 Glenn Randers-Pehrson * Copyright (c) 1998-2011 Glenn Randers-Pehrson
* *

View File

@ -1,9 +1,9 @@
Makefiles for libpng version 1.7.0beta65 - September 16, 2015 Makefiles for libpng version 1.7.0beta66 - September 18, 2015
pnglibconf.h.prebuilt => Stores configuration settings pnglibconf.h.prebuilt => Stores configuration settings
makefile.linux => Linux/ELF makefile makefile.linux => Linux/ELF makefile
(gcc, creates libpng17.so.17.1.7.0beta65) (gcc, creates libpng17.so.17.1.7.0beta66)
makefile.gcc => Generic makefile (gcc, creates static libpng.a) makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from ansi2knr (Requires ansi2knr.c from
@ -33,12 +33,12 @@ pnglibconf.h.prebuilt => Stores configuration settings
makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def) makefile.os2 => OS/2 Makefile (gcc and emx, requires libpng.def)
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.sggcc => Silicon Graphics (gcc, makefile.sggcc => Silicon Graphics (gcc,
creates libpng17.so.17.1.7.0beta65) creates libpng17.so.17.1.7.0beta66)
makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib) makefile.sgi => Silicon Graphics IRIX makefile (cc, creates static lib)
makefile.solaris => Solaris 2.X makefile (gcc, makefile.solaris => Solaris 2.X makefile (gcc,
creates libpng17.so.17.1.7.0beta65) creates libpng17.so.17.1.7.0beta66)
makefile.so9 => Solaris 9 makefile (gcc, makefile.so9 => Solaris 9 makefile (gcc,
creates libpng17.so.17.1.7.0beta65) creates libpng17.so.17.1.7.0beta66)
makefile.std => Generic UNIX makefile (cc, creates static libpng.a) makefile.std => Generic UNIX makefile (cc, creates static libpng.a)
makefile.sunos => Sun makefile makefile.sunos => Sun makefile
makefile.32sunu => Sun Ultra 32-bit makefile makefile.32sunu => Sun Ultra 32-bit makefile

View File

@ -21,7 +21,7 @@ PNG_DFN "OS2 DESCRIPTION "PNG image compression library""
PNG_DFN "OS2 CODE PRELOAD MOVEABLE DISCARDABLE" PNG_DFN "OS2 CODE PRELOAD MOVEABLE DISCARDABLE"
PNG_DFN "" PNG_DFN ""
PNG_DFN "EXPORTS" PNG_DFN "EXPORTS"
PNG_DFN ";Version 1.7.0beta65" PNG_DFN ";Version 1.7.0beta66"
#define PNG_EXPORTA(ordinal, type, name, args, attributes)\ #define PNG_EXPORTA(ordinal, type, name, args, attributes)\
PNG_DFN "@" SYMBOL_PREFIX "@@" name "@" PNG_DFN "@" SYMBOL_PREFIX "@@" name "@"

View File

@ -11,7 +11,7 @@
# Modeled after libxml-config. # Modeled after libxml-config.
version=1.7.0beta65 version=1.7.0beta66
prefix="" prefix=""
libdir="" libdir=""
libs="" libs=""

View File

@ -5,6 +5,6 @@ includedir=@includedir@/libpng17
Name: libpng Name: libpng
Description: Loads and saves PNG files Description: Loads and saves PNG files
Version: 1.7.0beta65 Version: 1.7.0beta66
Libs: -L${libdir} -lpng17 Libs: -L${libdir} -lpng17
Cflags: -I${includedir} Cflags: -I${includedir}

View File

@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include/libpng17
LIB= png17 LIB= png17
SHLIB_MAJOR= 0 SHLIB_MAJOR= 0
SHLIB_MINOR= 1.7.0beta65 SHLIB_MINOR= 1.7.0beta66
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c pngwtran.c pngmem.c pngerror.c pngpread.c

View File

@ -17,7 +17,7 @@ INCSDIR=${LOCALBASE}/include
LIB= png LIB= png
SHLIB_MAJOR= 17 SHLIB_MAJOR= 17
SHLIB_MINOR= 1.7.0beta65 SHLIB_MINOR= 1.7.0beta66
SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \ SRCS= png.c pngset.c pngget.c pngrutil.c pngtrans.c pngwutil.c \
pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \ pngread.c pngrio.c pngwio.c pngwrite.c pngrtran.c \
pngwtran.c pngmem.c pngerror.c pngpread.c pngwtran.c pngmem.c pngerror.c pngpread.c

View File

@ -11,7 +11,7 @@ LIBDIR= ${PREFIX}/lib
MANDIR= ${PREFIX}/man/cat MANDIR= ${PREFIX}/man/cat
SHLIB_MAJOR= 17 SHLIB_MAJOR= 17
SHLIB_MINOR= 1.7.0beta65 SHLIB_MINOR= 1.7.0beta66
LIB= png LIB= png
SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \ SRCS= png.c pngerror.c pngget.c pngmem.c pngpread.c \

View File

@ -1,8 +1,8 @@
/* libpng 1.7.0beta65 STANDARD API DEFINITION */ /* libpng 1.7.0beta66 STANDARD API DEFINITION */
/* pnglibconf.h - library build configuration */ /* pnglibconf.h - library build configuration */
/* Libpng version 1.7.0beta65 - September 16, 2015 */ /* Libpng version 1.7.0beta66 - September 18, 2015 */
/* Copyright (c) 1998-2015 Glenn Randers-Pehrson */ /* Copyright (c) 1998-2015 Glenn Randers-Pehrson */

View File

@ -1,4 +1,4 @@
;Version 1.7.0beta65 ;Version 1.7.0beta66
;-------------------------------------------------------------- ;--------------------------------------------------------------
; LIBPNG symbol list as a Win32 DEF file ; LIBPNG symbol list as a Win32 DEF file
; Contains all the symbols that can be exported from libpng ; Contains all the symbols that can be exported from libpng