mirror of https://github.com/stella-emu/stella.git
Updated included PNG library to version 1.6.2.
git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@2718 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
parent
d05bca9734
commit
f0ab412b33
|
@ -1,7 +1,7 @@
|
|||
|
||||
/* png.c - location for general purpose libpng functions
|
||||
*
|
||||
* Last changed in libpng 1.6.1 [March 28, 2013]
|
||||
* Last changed in libpng 1.6.2 [April 25, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
|
@ -14,7 +14,7 @@
|
|||
#include "pngpriv.h"
|
||||
|
||||
/* Generate a compiler error if there is an old png.h in the search path. */
|
||||
typedef png_libpng_version_1_6_1 Your_png_h_is_not_version_1_6_1;
|
||||
typedef png_libpng_version_1_6_2 Your_png_h_is_not_version_1_6_2;
|
||||
|
||||
/* 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
|
||||
|
@ -115,7 +115,7 @@ png_calculate_crc(png_structrp png_ptr, png_const_bytep ptr, png_size_t length)
|
|||
{
|
||||
int need_crc = 1;
|
||||
|
||||
if (PNG_CHUNK_ANCILLIARY(png_ptr->chunk_name))
|
||||
if (PNG_CHUNK_ANCILLARY(png_ptr->chunk_name))
|
||||
{
|
||||
if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) ==
|
||||
(PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN))
|
||||
|
@ -768,13 +768,13 @@ png_get_copyright(png_const_structrp png_ptr)
|
|||
#else
|
||||
# ifdef __STDC__
|
||||
return PNG_STRING_NEWLINE \
|
||||
"libpng version 1.6.1 - March 28, 2013" PNG_STRING_NEWLINE \
|
||||
"libpng version 1.6.2 - April 25, 2013" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1998-2013 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
|
||||
"Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc." \
|
||||
PNG_STRING_NEWLINE;
|
||||
# else
|
||||
return "libpng version 1.6.1 - March 28, 2013\
|
||||
return "libpng version 1.6.2 - April 25, 2013\
|
||||
Copyright (c) 1998-2013 Glenn Randers-Pehrson\
|
||||
Copyright (c) 1996-1997 Andreas Dilger\
|
||||
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.";
|
||||
|
@ -1866,7 +1866,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
|||
"length does not match profile");
|
||||
|
||||
temp = png_get_uint_32(profile+128); /* tag count: 12 bytes/tag */
|
||||
if (temp > 357913930 || /* (2^32-4-132)/12: maxium possible tag count */
|
||||
if (temp > 357913930 || /* (2^32-4-132)/12: maximum possible tag count */
|
||||
profile_length < 132+12*temp) /* truncated tag table */
|
||||
return png_icc_profile_error(png_ptr, colorspace, name, temp,
|
||||
"tag count too large");
|
||||
|
@ -2275,7 +2275,10 @@ png_colorspace_set_ICC(png_const_structrp png_ptr, png_colorspacerp colorspace,
|
|||
png_icc_check_tag_table(png_ptr, colorspace, name, profile_length,
|
||||
profile))
|
||||
{
|
||||
# ifdef PNG_sRGB_SUPPORTED
|
||||
/* If no sRGB support, don't try storing sRGB information */
|
||||
png_icc_set_sRGB(png_ptr, colorspace, profile, 0);
|
||||
# endif
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
/* png.h - header file for PNG reference library
|
||||
*
|
||||
* libpng version 1.6.1 - March 28, 2013
|
||||
* libpng version 1.6.2 - April 25, 2013
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
|
@ -11,7 +11,7 @@
|
|||
* Authors and maintainers:
|
||||
* libpng versions 0.71, May 1995, through 0.88, January 1996: Guy Schalnat
|
||||
* libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
|
||||
* libpng versions 0.97, January 1998, through 1.6.1 - March 28, 2013: Glenn
|
||||
* libpng versions 0.97, January 1998, through 1.6.2 - April 25, 2013: Glenn
|
||||
* See also "Contributing Authors", below.
|
||||
*
|
||||
* Note about libpng version numbers:
|
||||
|
@ -169,9 +169,12 @@
|
|||
* 1.6.0beta01-40 16 10600 16.so.16.0[.0]
|
||||
* 1.6.0rc01-08 16 10600 16.so.16.0[.0]
|
||||
* 1.6.0 16 10600 16.so.16.0[.0]
|
||||
* 1.6.1beta01-10 16 10601 16.so.16.1[.0]
|
||||
* 1.6.1beta01-09 16 10601 16.so.16.1[.0]
|
||||
* 1.6.1rc01 16 10601 16.so.16.1[.0]
|
||||
* 1.6.1 16 10601 16.so.16.1[.0]
|
||||
* 1.6.2beta01 16 10602 16.so.16.2[.0]
|
||||
* 1.6.2rc01-06 16 10602 16.so.16.2[.0]
|
||||
* 1.6.2 16 10602 16.so.16.2[.0]
|
||||
*
|
||||
* Henceforth the source version will match the shared-library major
|
||||
* and minor numbers; the shared-library major version number will be
|
||||
|
@ -203,7 +206,7 @@
|
|||
*
|
||||
* This code is released under the libpng license.
|
||||
*
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.6.1, March 28, 2013, are
|
||||
* libpng versions 1.2.6, August 15, 2004, through 1.6.2, April 25, 2013, are
|
||||
* Copyright (c) 2004, 2006-2013 Glenn Randers-Pehrson, and are
|
||||
* distributed according to the same disclaimer and license as libpng-1.2.5
|
||||
* with the following individual added to the list of Contributing Authors:
|
||||
|
@ -315,13 +318,13 @@
|
|||
* Y2K compliance in libpng:
|
||||
* =========================
|
||||
*
|
||||
* March 28, 2013
|
||||
* April 25, 2013
|
||||
*
|
||||
* Since the PNG Development group is an ad-hoc body, we can't make
|
||||
* an official declaration.
|
||||
*
|
||||
* This is your unofficial assurance that libpng from version 0.71 and
|
||||
* upward through 1.6.1 are Y2K compliant. It is my belief that
|
||||
* upward through 1.6.2 are Y2K compliant. It is my belief that
|
||||
* earlier versions were also Y2K compliant.
|
||||
*
|
||||
* Libpng only has two year fields. One is a 2-byte unsigned integer
|
||||
|
@ -381,9 +384,9 @@
|
|||
*/
|
||||
|
||||
/* Version information for png.h - this should match the version in png.c */
|
||||
#define PNG_LIBPNG_VER_STRING "1.6.1"
|
||||
#define PNG_LIBPNG_VER_STRING "1.6.2"
|
||||
#define PNG_HEADER_VERSION_STRING \
|
||||
" libpng version 1.6.1 - March 28, 2013\n"
|
||||
" libpng version 1.6.2 - April 25, 2013\n"
|
||||
|
||||
#define PNG_LIBPNG_VER_SONUM 16
|
||||
#define PNG_LIBPNG_VER_DLLNUM 16
|
||||
|
@ -391,7 +394,7 @@
|
|||
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
|
||||
#define PNG_LIBPNG_VER_MAJOR 1
|
||||
#define PNG_LIBPNG_VER_MINOR 6
|
||||
#define PNG_LIBPNG_VER_RELEASE 1
|
||||
#define PNG_LIBPNG_VER_RELEASE 2
|
||||
|
||||
/* This should match the numeric part of the final component of
|
||||
* PNG_LIBPNG_VER_STRING, omitting any leading zero:
|
||||
|
@ -422,7 +425,7 @@
|
|||
* version 1.0.0 was mis-numbered 100 instead of 10000). From
|
||||
* version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
|
||||
*/
|
||||
#define PNG_LIBPNG_VER 10601 /* 1.6.1 */
|
||||
#define PNG_LIBPNG_VER 10602 /* 1.6.2 */
|
||||
|
||||
/* Library configuration: these options cannot be changed after
|
||||
* the library has been built.
|
||||
|
@ -527,7 +530,7 @@ extern "C" {
|
|||
/* This triggers a compiler error in png.c, if png.c and png.h
|
||||
* do not agree upon the version number.
|
||||
*/
|
||||
typedef char* png_libpng_version_1_6_1;
|
||||
typedef char* png_libpng_version_1_6_2;
|
||||
|
||||
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
|
||||
*
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
/* pngconf.h - machine configurable file for libpng
|
||||
*
|
||||
* libpng version 1.6.1 - March 28, 2013
|
||||
* libpng version 1.6.2 - April 25, 2013
|
||||
*
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
/* pnglibconf.h - library build configuration */
|
||||
|
||||
/* libpng version 1.6.1 - March 28, 2013 */
|
||||
/* libpng version 1.6.2 - April 25, 2013 */
|
||||
|
||||
/* Copyright (c) 1998-2012 Glenn Randers-Pehrson */
|
||||
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
*
|
||||
* Last changed in libpng 1.6.1 [March 28, 2013]
|
||||
* Last changed in libpng 1.6.2 [April 25, 2013]
|
||||
*
|
||||
* This code is released under the libpng license.
|
||||
* For conditions of distribution and use, see the disclaimer
|
||||
|
@ -675,8 +675,8 @@
|
|||
(void)(PNG_STRING_FROM_CHUNK(s,c), ((char*)(s))[4] = 0)
|
||||
|
||||
/* Test on flag values as defined in the spec (section 5.4): */
|
||||
#define PNG_CHUNK_ANCILLIARY(c) (1 & ((c) >> 29))
|
||||
#define PNG_CHUNK_CRITICAL(c) (!PNG_CHUNK_ANCILLIARY(c))
|
||||
#define PNG_CHUNK_ANCILLARY(c) (1 & ((c) >> 29))
|
||||
#define PNG_CHUNK_CRITICAL(c) (!PNG_CHUNK_ANCILLARY(c))
|
||||
#define PNG_CHUNK_PRIVATE(c) (1 & ((c) >> 21))
|
||||
#define PNG_CHUNK_RESERVED(c) (1 & ((c) >> 13))
|
||||
#define PNG_CHUNK_SAFE_TO_COPY(c) (1 & ((c) >> 5))
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
/* pngrtran.c - transforms the data in a row for PNG readers
|
||||
*
|
||||
* Last changed in libpng 1.6.1 [March 28, 2013]
|
||||
* Last changed in libpng 1.6.2 [April 25, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
|
@ -223,6 +223,8 @@ translate_gamma_flags(png_structrp png_ptr, png_fixed_point output_gamma,
|
|||
*/
|
||||
# ifdef PNG_READ_sRGB_SUPPORTED
|
||||
png_ptr->flags |= PNG_FLAG_ASSUME_sRGB;
|
||||
# else
|
||||
PNG_UNUSED(png_ptr)
|
||||
# endif
|
||||
if (is_screen)
|
||||
output_gamma = PNG_GAMMA_sRGB;
|
||||
|
@ -1056,9 +1058,6 @@ png_set_read_user_transform_fn(png_structrp png_ptr, png_user_transform_ptr
|
|||
{
|
||||
png_debug(1, "in png_set_read_user_transform_fn");
|
||||
|
||||
if (!png_rtran_ok(png_ptr, 0))
|
||||
return;
|
||||
|
||||
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
|
||||
png_ptr->transformations |= PNG_USER_TRANSFORM;
|
||||
png_ptr->read_user_transform_fn = read_user_transform_fn;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
/* pngrutil.c - utilities to read a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.6.1 [March 28, 2013]
|
||||
* Last changed in libpng 1.6.2 [April 25, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
|
@ -221,7 +221,7 @@ png_crc_finish(png_structrp png_ptr, png_uint_32 skip)
|
|||
|
||||
if (png_crc_error(png_ptr))
|
||||
{
|
||||
if (PNG_CHUNK_ANCILLIARY(png_ptr->chunk_name) ?
|
||||
if (PNG_CHUNK_ANCILLARY(png_ptr->chunk_name) ?
|
||||
!(png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_NOWARN) :
|
||||
(png_ptr->flags & PNG_FLAG_CRC_CRITICAL_USE))
|
||||
{
|
||||
|
@ -250,7 +250,7 @@ png_crc_error(png_structrp png_ptr)
|
|||
png_uint_32 crc;
|
||||
int need_crc = 1;
|
||||
|
||||
if (PNG_CHUNK_ANCILLIARY(png_ptr->chunk_name))
|
||||
if (PNG_CHUNK_ANCILLARY(png_ptr->chunk_name))
|
||||
{
|
||||
if ((png_ptr->flags & PNG_FLAG_CRC_ANCILLARY_MASK) ==
|
||||
(PNG_FLAG_CRC_ANCILLARY_USE | PNG_FLAG_CRC_ANCILLARY_NOWARN))
|
||||
|
@ -2857,7 +2857,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
|
|||
|
||||
if (keep == PNG_HANDLE_CHUNK_ALWAYS ||
|
||||
(keep == PNG_HANDLE_CHUNK_IF_SAFE &&
|
||||
PNG_CHUNK_ANCILLIARY(png_ptr->chunk_name)))
|
||||
PNG_CHUNK_ANCILLARY(png_ptr->chunk_name)))
|
||||
{
|
||||
if (!png_cache_unknown_chunk(png_ptr, length))
|
||||
keep = PNG_HANDLE_CHUNK_NEVER;
|
||||
|
@ -2891,7 +2891,7 @@ png_handle_unknown(png_structrp png_ptr, png_inforp info_ptr,
|
|||
*/
|
||||
if (keep == PNG_HANDLE_CHUNK_ALWAYS ||
|
||||
(keep == PNG_HANDLE_CHUNK_IF_SAFE &&
|
||||
PNG_CHUNK_ANCILLIARY(png_ptr->chunk_name)))
|
||||
PNG_CHUNK_ANCILLARY(png_ptr->chunk_name)))
|
||||
{
|
||||
# ifdef PNG_USER_LIMITS_SUPPORTED
|
||||
switch (png_ptr->user_chunk_cache_max)
|
||||
|
@ -3875,7 +3875,7 @@ png_init_filter_functions(png_structrp pp)
|
|||
* the filter is the first transformation performed on the row data. It is
|
||||
* performed in place, therefore an implementation can be selected based on
|
||||
* the image pixel format. If the implementation depends on image width then
|
||||
* take care to ensure that it works corretly if the image is interlaced -
|
||||
* take care to ensure that it works correctly if the image is interlaced -
|
||||
* interlacing causes the actual row width to vary.
|
||||
*/
|
||||
{
|
||||
|
@ -3983,7 +3983,7 @@ png_read_IDAT_data(png_structrp png_ptr, png_bytep output,
|
|||
png_ptr->zstream.avail_out = out;
|
||||
}
|
||||
|
||||
else /* check for end */
|
||||
else /* after last row, checking for end */
|
||||
{
|
||||
png_ptr->zstream.next_out = tmpbuf;
|
||||
png_ptr->zstream.avail_out = (sizeof tmpbuf);
|
||||
|
@ -3998,10 +3998,13 @@ png_read_IDAT_data(png_structrp png_ptr, png_bytep output,
|
|||
*/
|
||||
ret = inflate(&png_ptr->zstream, Z_NO_FLUSH);
|
||||
|
||||
/* Take the unconsumed output back (so, in the 'check' case this just
|
||||
* counts up).
|
||||
*/
|
||||
/* Take the unconsumed output back. */
|
||||
if (output != NULL)
|
||||
avail_out += png_ptr->zstream.avail_out;
|
||||
|
||||
else /* avail_out counts the extra bytes */
|
||||
avail_out += (sizeof tmpbuf) - png_ptr->zstream.avail_out;
|
||||
|
||||
png_ptr->zstream.avail_out = 0;
|
||||
|
||||
if (ret == Z_STREAM_END)
|
||||
|
@ -4040,7 +4043,7 @@ png_read_IDAT_data(png_structrp png_ptr, png_bytep output,
|
|||
if (output != NULL)
|
||||
png_error(png_ptr, "Not enough image data");
|
||||
|
||||
else /* checking */
|
||||
else /* the deflate stream contained extra data */
|
||||
png_chunk_benign_error(png_ptr, "Too much image data");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
/* pngset.c - storage of image information into info struct
|
||||
*
|
||||
* Last changed in libpng 1.6.1 [March 28, 2013]
|
||||
* Last changed in libpng 1.6.2 [April 25, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
|
||||
*
|
||||
* Last changed in libpng 1.6.0 [February 14, 2013]
|
||||
* Last changed in libpng 1.6.2 [April 25, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
|
@ -782,6 +782,17 @@ png_set_user_transform_info(png_structrp png_ptr, png_voidp
|
|||
|
||||
if (png_ptr == NULL)
|
||||
return;
|
||||
|
||||
#ifdef PNG_READ_USER_TRANSFORM_SUPPORTED
|
||||
if ((png_ptr->mode & PNG_IS_READ_STRUCT) != 0 &&
|
||||
(png_ptr->flags & PNG_FLAG_ROW_INIT) != 0)
|
||||
{
|
||||
png_app_error(png_ptr,
|
||||
"info change after png_start_read_image or png_read_update_info");
|
||||
return;
|
||||
}
|
||||
#endif
|
||||
|
||||
png_ptr->user_transform_ptr = user_transform_ptr;
|
||||
png_ptr->user_transform_depth = (png_byte)user_transform_depth;
|
||||
png_ptr->user_transform_channels = (png_byte)user_transform_channels;
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
/* pngwrite.c - general routines to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.6.1 [March 28, 2013]
|
||||
* Last changed in libpng 1.6.2 [April 25, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
|
||||
/* pngwutil.c - utilities to write a PNG file
|
||||
*
|
||||
* Last changed in libpng 1.6.0 [February 14, 2013]
|
||||
* Last changed in libpng 1.6.2 [April 25, 2013]
|
||||
* Copyright (c) 1998-2013 Glenn Randers-Pehrson
|
||||
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
|
||||
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
|
||||
|
@ -1744,6 +1744,9 @@ png_write_iTXt(png_structrp png_ptr, int compression, png_const_charp key,
|
|||
{
|
||||
if (comp.input_len > PNG_UINT_31_MAX-prefix_len)
|
||||
png_error(png_ptr, "iTXt: uncompressed text too long");
|
||||
|
||||
/* So the string will fit in a chunk: */
|
||||
comp.output_len = (png_uint_32)/*SAFE*/comp.input_len;
|
||||
}
|
||||
|
||||
png_write_chunk_header(png_ptr, png_iTXt, comp.output_len + prefix_len);
|
||||
|
|
Loading…
Reference in New Issue