Updated PNG library to latest version

Decided that the next version will be 4.5, since it requires new compilers
and, in the OSX case, a newer version of the OS.


git-svn-id: svn://svn.code.sf.net/p/stella/code/trunk@3069 8b62c5a3-ac7e-4cc8-8f21-d9a121418aba
This commit is contained in:
stephena 2014-11-10 20:27:29 +00:00
parent 2095b29873
commit e352b3a6bb
20 changed files with 230 additions and 319 deletions

View File

@ -9,7 +9,7 @@
SSSS ttt eeeee llll llll aaaaa SSSS ttt eeeee llll llll aaaaa
=========================================================================== ===========================================================================
Release 4.2 for Linux, MacOSX and Windows Release 4.5 for Linux, MacOSX and Windows
=========================================================================== ===========================================================================
The Atari 2600 Video Computer System (VCS), introduced in 1977, was the The Atari 2600 Video Computer System (VCS), introduced in 1977, was the
@ -21,27 +21,27 @@ all of your favourite Atari 2600 games again! Stella was originally
developed for Linux by Bradford W. Mott, however, it has been ported to a developed for Linux by Bradford W. Mott, however, it has been ported to a
number of other platforms and is currently maintained by Stephen Anthony. number of other platforms and is currently maintained by Stephen Anthony.
This is the 4.2 release of Stella for Linux, Mac OSX and Windows. The This is the 4.5 release of Stella for Linux, Mac OSX and Windows. The
distributions currently available are: distributions currently available are:
* Binaries for Windows XP_SP3/Vista/7/8 : * Binaries for Windows XP_SP3/Vista/7/8 :
Stella-4.2-win32.exe (32-bit EXE installer) Stella-4.5-win32.exe (32-bit EXE installer)
Stella-4.2-x64.exe (64-bit EXE installer) Stella-4.5-x64.exe (64-bit EXE installer)
Stella-4.2-windows.zip (32/64 bit versions) Stella-4.5-windows.zip (32/64 bit versions)
* Binary distribution for MacOS X 10.7 and above : * Binary distribution for MacOS X 10.7 and above :
Stella-4.2-macosx.dmg (64-bit Intel) Stella-4.5-macosx.dmg (64-bit Intel)
* Binary distribution in 32-bit & 64-bit Ubuntu DEB format : * Binary distribution in 32-bit & 64-bit Ubuntu DEB format :
stella_4.2-1_i386.deb stella_4.5-1_i386.deb
stella_4.2-1_amd64.deb stella_4.5-1_amd64.deb
* Binary distribution in 32-bit & 64-bit RPM format : * Binary distribution in 32-bit & 64-bit RPM format :
stella-4.2-2.i386.rpm stella-4.5-2.i386.rpm
stella-4.2-2.x86_64.rpm stella-4.5-2.x86_64.rpm
* Source code distribution for all platforms : * Source code distribution for all platforms :
stella-4.2-src.tar.gz stella-4.5-src.tar.gz
Distribution Site Distribution Site

View File

@ -21,7 +21,9 @@
* The minimum supported version for the OSX port is now OSX 10.7. * The minimum supported version for the OSX port is now OSX 10.7.
Because of this, the 32-bit version is also discontinued, as 10.7 Because of this, the 32-bit version is also discontinued, as 10.7
is 64-bit only. is 64-bit Intel only.
* Updated included PNG library to latest stable version.
-Have fun! -Have fun!

7
debian/changelog vendored
View File

@ -1,3 +1,10 @@
stella (4.5-1) stable; urgency=high
* Version 4.5 release
-- Stephen Anthony <stephena@users.sf.net> Mon, 10 Nov 2014 16:54:34 -0330
stella (4.2-1) stable; urgency=high stella (4.2-1) stable; urgency=high
* Version 4.2 release * Version 4.2 release

View File

@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions /* png.c - location for general purpose libpng functions
* *
* Last changed in libpng 1.6.12 [June 12, 2014] * Last changed in libpng 1.6.14 [October 23, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -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_12 Your_png_h_is_not_version_1_6_12; typedef png_libpng_version_1_6_14 Your_png_h_is_not_version_1_6_14;
/* 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
@ -773,13 +773,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.6.12 - June 12, 2014" PNG_STRING_NEWLINE \ "libpng version 1.6.14 - October 23, 2014" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2014 Glenn Randers-Pehrson" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2014 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.6.12 - June 12, 2014\ return "libpng version 1.6.14 - October 23, 2014\
Copyright (c) 1998-2014 Glenn Randers-Pehrson\ Copyright (c) 1998-2014 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.";
@ -2219,10 +2219,12 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr,
#endif #endif
unsigned int i; unsigned int i;
#ifdef PNG_SET_OPTION_SUPPORTED
/* First see if PNG_SKIP_sRGB_CHECK_PROFILE has been set to "on" */ /* First see if PNG_SKIP_sRGB_CHECK_PROFILE has been set to "on" */
if (((png_ptr->options >> PNG_SKIP_sRGB_CHECK_PROFILE) & 3) == if (((png_ptr->options >> PNG_SKIP_sRGB_CHECK_PROFILE) & 3) ==
PNG_OPTION_ON) PNG_OPTION_ON)
return 0; return 0;
#endif
for (i=0; i < (sizeof png_sRGB_checks) / (sizeof png_sRGB_checks[0]); ++i) for (i=0; i < (sizeof png_sRGB_checks) / (sizeof png_sRGB_checks[0]); ++i)
{ {
@ -2293,8 +2295,8 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr,
*/ */
else if (!png_sRGB_checks[i].have_md5) else if (!png_sRGB_checks[i].have_md5)
{ {
png_chunk_report(png_ptr, png_chunk_report(png_ptr, "out-of-date sRGB profile with"
"out-of-date sRGB profile with no signature", " no signature",
PNG_CHUNK_WARNING); PNG_CHUNK_WARNING);
} }
@ -2307,8 +2309,8 @@ png_compare_ICC_profile_with_sRGB(png_const_structrp png_ptr,
* way. This probably indicates a data error or uninformed hacking. * way. This probably indicates a data error or uninformed hacking.
* Fall through to "no match". * Fall through to "no match".
*/ */
png_chunk_report(png_ptr, png_chunk_report(png_ptr, "Not recognizing known sRGB profile that"
"Not recognizing known sRGB profile that has been edited", " has been edited",
PNG_CHUNK_WARNING); PNG_CHUNK_WARNING);
break; break;
# endif # endif
@ -3569,8 +3571,8 @@ png_log16bit(png_uint_32 x)
* each case only the low 16 bits are relevant - the fraction - since the * each case only the low 16 bits are relevant - the fraction - since the
* integer bits (the top 4) simply determine a shift. * integer bits (the top 4) simply determine a shift.
* *
* The worst case is the 16-bit distinction between 65535 and 65534, this * The worst case is the 16-bit distinction between 65535 and 65534. This
* requires perhaps spurious accuracty in the decoding of the logarithm to * requires perhaps spurious accuracy in the decoding of the logarithm to
* distinguish log2(65535/65534.5) - 10^-5 or 17 bits. There is little chance * distinguish log2(65535/65534.5) - 10^-5 or 17 bits. There is little chance
* of getting this accuracy in practice. * of getting this accuracy in practice.
* *
@ -3658,7 +3660,7 @@ png_exp8bit(png_fixed_point lg2)
/* Get a 32-bit value: */ /* Get a 32-bit value: */
png_uint_32 x = png_exp(lg2); png_uint_32 x = png_exp(lg2);
/* Convert the 32-bit value to 0..255 by multiplying by 256-1, note that the /* Convert the 32-bit value to 0..255 by multiplying by 256-1. Note that the
* second, rounding, step can't overflow because of the first, subtraction, * second, rounding, step can't overflow because of the first, subtraction,
* step. * step.
*/ */
@ -3840,7 +3842,7 @@ png_build_16to8_table(png_structrp png_ptr, png_uint_16pp *ptable,
/* 'num' is the number of tables and also the number of low bits of low /* 'num' is the number of tables and also the number of low bits of low
* bits of the input 16-bit value used to select a table. Each table is * bits of the input 16-bit value used to select a table. Each table is
* itself index by the high 8 bits of the value. * itself indexed by the high 8 bits of the value.
*/ */
for (i = 0; i < num; i++) for (i = 0; i < num; i++)
table[i] = (png_uint_16p)png_malloc(png_ptr, table[i] = (png_uint_16p)png_malloc(png_ptr,
@ -3892,7 +3894,7 @@ png_build_16to8_table(png_structrp png_ptr, png_uint_16pp *ptable,
/* Build a single 8-bit table: same as the 16-bit case but much simpler (and /* Build a single 8-bit table: same as the 16-bit case but much simpler (and
* typically much faster). Note that libpng currently does no sBIT processing * typically much faster). Note that libpng currently does no sBIT processing
* (apparently contrary to the spec) so a 256 entry table is always generated. * (apparently contrary to the spec) so a 256-entry table is always generated.
*/ */
static void static void
png_build_8bit_table(png_structrp png_ptr, png_bytepp ptable, png_build_8bit_table(png_structrp png_ptr, png_bytepp ptable,
@ -4033,7 +4035,7 @@ png_build_gamma_table(png_structrp png_ptr, int bit_depth)
* Where 'iv' is the input color value and 'ov' is the output value - * Where 'iv' is the input color value and 'ov' is the output value -
* pow(iv, gamma). * pow(iv, gamma).
* *
* Thus the gamma table consists of up to 256 256 entry tables. The table * Thus the gamma table consists of up to 256 256-entry tables. The table
* is selected by the (8-gamma_shift) most significant of the low 8 bits of * is selected by the (8-gamma_shift) most significant of the low 8 bits of
* the color value then indexed by the upper 8 bits: * the color value then indexed by the upper 8 bits:
* *
@ -4141,7 +4143,7 @@ png_set_option(png_structrp png_ptr, int option, int onoff)
* *
* error: -0.513727 - 0.607759, 308 (0.469978%) of readings inexact * error: -0.513727 - 0.607759, 308 (0.469978%) of readings inexact
* *
* In all cases the inexact readings are off by one. * In all cases the inexact readings are only off by one.
*/ */
#ifdef PNG_SIMPLIFIED_READ_SUPPORTED #ifdef PNG_SIMPLIFIED_READ_SUPPORTED
@ -4181,8 +4183,7 @@ const png_uint_16 png_sRGB_table[256] =
57105,57646,58190,58737,59287,59840,60396,60955, 57105,57646,58190,58737,59287,59840,60396,60955,
61517,62082,62650,63221,63795,64372,64952,65535 61517,62082,62650,63221,63795,64372,64952,65535
}; };
#endif /* PNG_SIMPLIFIED_READ_SUPPORTED */
#endif /* simplified read only */
/* The base/delta tables are required for both read and write (but currently /* The base/delta tables are required for both read and write (but currently
* only the simplified versions.) * only the simplified versions.)

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.6.12 - June 12, 2014 * libpng version 1.6.14 - October 23, 2014
* Copyright (c) 1998-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -11,7 +11,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.89c, June 1996, through 0.96, May 1997: Andreas Dilger * libpng versions 0.89c, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.12 - June 12, 2014: Glenn * libpng versions 0.97, January 1998, through 1.6.14 - October 23, 2014: Glenn
* See also "Contributing Authors", below. * See also "Contributing Authors", below.
* *
* Note about libpng version numbers: * Note about libpng version numbers:
@ -200,6 +200,12 @@
* 1.6.11 16 10611 16.so.16.11[.0] * 1.6.11 16 10611 16.so.16.11[.0]
* 1.6.12rc01-03 16 10612 16.so.16.12[.0] * 1.6.12rc01-03 16 10612 16.so.16.12[.0]
* 1.6.12 16 10612 16.so.16.12[.0] * 1.6.12 16 10612 16.so.16.12[.0]
* 1.6.13beta01-04 16 10613 16.so.16.13[.0]
* 1.6.13rc01-02 16 10613 16.so.16.13[.0]
* 1.6.13 16 10613 16.so.16.13[.0]
* 1.6.14beta01-07 16 10614 16.so.16.14[.0]
* 1.6.14rc01-02 16 10614 16.so.16.14[.0]
* 1.6.14 16 10614 16.so.16.14[.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
@ -231,7 +237,7 @@
* *
* This code is released under the libpng license. * This code is released under the libpng license.
* *
* libpng versions 1.2.6, August 15, 2004, through 1.6.12, June 12, 2014, are * libpng versions 1.2.6, August 15, 2004, through 1.6.14, October 23, 2014, are
* Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are * Copyright (c) 2004, 2006-2014 Glenn Randers-Pehrson, and are
* distributed according to the same disclaimer and license as libpng-1.2.5 * distributed according to the same disclaimer and license as libpng-1.2.5
* with the following individual added to the list of Contributing Authors: * with the following individual added to the list of Contributing Authors:
@ -343,13 +349,13 @@
* Y2K compliance in libpng: * Y2K compliance in libpng:
* ========================= * =========================
* *
* June 12, 2014 * October 23, 2014
* *
* 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.6.12 are Y2K compliant. It is my belief that * upward through 1.6.14 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
@ -411,9 +417,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.6.12" #define PNG_LIBPNG_VER_STRING "1.6.14"
#define PNG_HEADER_VERSION_STRING \ #define PNG_HEADER_VERSION_STRING \
" libpng version 1.6.12 - June 12, 2014\n" " libpng version 1.6.14 - October 23, 2014\n"
#define PNG_LIBPNG_VER_SONUM 16 #define PNG_LIBPNG_VER_SONUM 16
#define PNG_LIBPNG_VER_DLLNUM 16 #define PNG_LIBPNG_VER_DLLNUM 16
@ -421,7 +427,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6 #define PNG_LIBPNG_VER_MINOR 6
#define PNG_LIBPNG_VER_RELEASE 12 #define PNG_LIBPNG_VER_RELEASE 14
/* This should match the numeric part of the final component of /* This should match the numeric part of the final component of
* PNG_LIBPNG_VER_STRING, omitting any leading zero: * PNG_LIBPNG_VER_STRING, omitting any leading zero:
@ -452,7 +458,7 @@
* version 1.0.0 was mis-numbered 100 instead of 10000). From * 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 * version 1.0.1 it's xxyyzz, where x=major, y=minor, z=release
*/ */
#define PNG_LIBPNG_VER 10612 /* 1.6.12 */ #define PNG_LIBPNG_VER 10614 /* 1.6.14 */
/* Library configuration: these options cannot be changed after /* Library configuration: these options cannot be changed after
* the library has been built. * the library has been built.
@ -557,7 +563,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_6_12; typedef char* png_libpng_version_1_6_14;
/* 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.
* *
@ -2742,6 +2748,8 @@ PNG_EXPORT(207, void, png_save_uint_16, (png_bytep buf, unsigned int i));
# endif # endif
#endif #endif
#if defined(PNG_SIMPLIFIED_READ_SUPPORTED) || \
defined(PNG_SIMPLIFIED_WRITE_SUPPORTED)
/******************************************************************************* /*******************************************************************************
* SIMPLIFIED API * SIMPLIFIED API
******************************************************************************* *******************************************************************************
@ -2813,7 +2821,7 @@ typedef struct
# define PNG_IMAGE_WARNING 1 # define PNG_IMAGE_WARNING 1
# define PNG_IMAGE_ERROR 2 # define PNG_IMAGE_ERROR 2
/* /*
* The result is a two bit code such that a value more than 1 indicates * The result is a two-bit code such that a value more than 1 indicates
* a failure in the API just called: * a failure in the API just called:
* *
* 0 - no warning or error * 0 - no warning or error
@ -3194,6 +3202,7 @@ PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file,
/******************************************************************************* /*******************************************************************************
* END OF SIMPLIFIED API * END OF SIMPLIFIED API
******************************************************************************/ ******************************************************************************/
#endif /* PNG_SIMPLIFIED_{READ|WRITE}_SUPPORTED */
#ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED #ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
PNG_EXPORT(242, void, png_set_check_for_invalid_index, PNG_EXPORT(242, void, png_set_check_for_invalid_index,
@ -3241,19 +3250,18 @@ PNG_EXPORT(243, int, png_get_palette_max, (png_const_structp png_ptr,
PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option,
int onoff)); int onoff));
#endif #endif /* PNG_SET_OPTION_SUPPORTED */
/******************************************************************************* /*******************************************************************************
* END OF HARDWARE AND SOFTWARE OPTIONS * END OF HARDWARE AND SOFTWARE OPTIONS
******************************************************************************/ ******************************************************************************/
/* Maintainer: Put new public prototypes here ^, in libpng.3, and project /* Maintainer: Put new public prototypes here ^, in libpng.3, in project
* defs, scripts/pnglibconf.h, and scripts/pnglibconf.h.prebuilt * defs, and in scripts/symbols.def.
*/ */
/* The last ordinal number (this is the *last* one already used; the next /* The last ordinal number (this is the *last* one already used; the next
* one to use is one more than this.) Maintainer, remember to add an entry to * one to use is one more than this.)
* scripts/symbols.def as well.
*/ */
#ifdef PNG_EXPORT_LAST_ORDINAL #ifdef PNG_EXPORT_LAST_ORDINAL
PNG_EXPORT_LAST_ORDINAL(244); PNG_EXPORT_LAST_ORDINAL(244);

View File

@ -1,7 +1,7 @@
/* pngconf.h - machine configurable file for libpng /* pngconf.h - machine configurable file for libpng
* *
* libpng version 1.6.12 - June 12, 2014 * libpng version 1.6.14 - October 23, 2014
* *
* Copyright (c) 1998-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)

View File

@ -1,7 +1,7 @@
/* pngerror.c - stub functions for i/o and memory allocation /* pngerror.c - stub functions for i/o and memory allocation
* *
* Last changed in libpng 1.6.11 [June 12, 2014] * Last changed in libpng 1.6.13 [August 21, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -415,10 +415,13 @@ png_app_error(png_const_structrp png_ptr, png_const_charp error_message)
} }
#endif /* BENIGN_ERRORS */ #endif /* BENIGN_ERRORS */
#define PNG_MAX_ERROR_TEXT 196 /* Currently limited by profile_error in png.c */
#if defined(PNG_WARNINGS_SUPPORTED) || \
(defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED))
/* These utilities are used internally to build an error message that relates /* These utilities are used internally to build an error message that relates
* to the current chunk. The chunk name comes from png_ptr->chunk_name, * to the current chunk. The chunk name comes from png_ptr->chunk_name,
* this is used to prefix the message. The message is limited in length * which is used to prefix the message. The message is limited in length
* to 63 bytes, the name characters are output as hex digits wrapped in [] * to 63 bytes. The name characters are output as hex digits wrapped in []
* if the character is invalid. * if the character is invalid.
*/ */
#define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97)) #define isnonalpha(c) ((c) < 65 || (c) > 122 || ((c) > 90 && (c) < 97))
@ -427,9 +430,6 @@ static PNG_CONST char png_digit[16] = {
'A', 'B', 'C', 'D', 'E', 'F' 'A', 'B', 'C', 'D', 'E', 'F'
}; };
#define PNG_MAX_ERROR_TEXT 196 /* Currently limited be profile_error in png.c */
#if defined(PNG_WARNINGS_SUPPORTED) || \
(defined(PNG_READ_SUPPORTED) && defined(PNG_ERROR_TEXT_SUPPORTED))
static void /* PRIVATE */ static void /* PRIVATE */
png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp png_format_buffer(png_const_structrp png_ptr, png_charp buffer, png_const_charp
error_message) error_message)

View File

@ -1,7 +1,7 @@
/* pngget.c - retrieval of values from info struct /* pngget.c - retrieval of values from info struct
* *
* Last changed in libpng 1.6.11 [June 12, 2014] * Last changed in libpng 1.6.11 [June 5, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)

View File

@ -1,7 +1,7 @@
/* pngpread.c - read a png file in push mode /* pngpread.c - read a png file in push mode
* *
* Last changed in libpng 1.6.11 [June 12, 2014] * Last changed in libpng 1.6.14 [October 23, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -26,6 +26,13 @@
#define PNG_READ_iTXt_MODE 7 #define PNG_READ_iTXt_MODE 7
#define PNG_ERROR_MODE 8 #define PNG_ERROR_MODE 8
#define PNG_PUSH_SAVE_BUFFER_IF_FULL \
if (png_ptr->push_length + 4 > png_ptr->buffer_size) \
{ png_push_save_buffer(png_ptr); return; }
#define PNG_PUSH_SAVE_BUFFER_IF_LT(N) \
if (png_ptr->buffer_size < N) \
{ png_push_save_buffer(png_ptr); return; }
void PNGAPI void PNGAPI
png_process_data(png_structrp png_ptr, png_inforp info_ptr, png_process_data(png_structrp png_ptr, png_inforp info_ptr,
png_bytep buffer, png_size_t buffer_size) png_bytep buffer, png_size_t buffer_size)
@ -46,7 +53,7 @@ png_process_data_pause(png_structrp png_ptr, int save)
{ {
if (png_ptr != NULL) if (png_ptr != NULL)
{ {
/* It's easiest for the caller if we do the save, then the caller doesn't /* It's easiest for the caller if we do the save; then the caller doesn't
* have to supply the same data again: * have to supply the same data again:
*/ */
if (save != 0) if (save != 0)
@ -189,10 +196,10 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
int keep; /* unknown handling method */ int keep; /* unknown handling method */
#endif #endif
/* First we make sure we have enough data for the 4 byte chunk name /* First we make sure we have enough data for the 4-byte chunk name
* and the 4 byte chunk length before proceeding with decoding the * and the 4-byte chunk length before proceeding with decoding the
* chunk data. To fully decode each of these chunks, we also make * chunk data. To fully decode each of these chunks, we also make
* sure we have enough data in the buffer for the 4 byte CRC at the * sure we have enough data in the buffer for the 4-byte CRC at the
* end of every chunk (except IDAT, which is handled separately). * end of every chunk (except IDAT, which is handled separately).
*/ */
if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER)) if (!(png_ptr->mode & PNG_HAVE_CHUNK_HEADER))
@ -200,12 +207,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
png_byte chunk_length[4]; png_byte chunk_length[4];
png_byte chunk_tag[4]; png_byte chunk_tag[4];
if (png_ptr->buffer_size < 8) PNG_PUSH_SAVE_BUFFER_IF_LT(8)
{
png_push_save_buffer(png_ptr);
return;
}
png_push_fill_buffer(png_ptr, chunk_length, 4); png_push_fill_buffer(png_ptr, chunk_length, 4);
png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length); png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length);
png_reset_crc(png_ptr); png_reset_crc(png_ptr);
@ -249,23 +251,13 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
if (png_ptr->push_length != 13) if (png_ptr->push_length != 13)
png_error(png_ptr, "Invalid IHDR length"); png_error(png_ptr, "Invalid IHDR length");
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length); png_handle_IHDR(png_ptr, info_ptr, png_ptr->push_length);
} }
else if (chunk_name == png_IEND) else if (chunk_name == png_IEND)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length); png_handle_IEND(png_ptr, info_ptr, png_ptr->push_length);
png_ptr->process_mode = PNG_READ_DONE_MODE; png_ptr->process_mode = PNG_READ_DONE_MODE;
@ -275,12 +267,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED #ifdef PNG_HANDLE_AS_UNKNOWN_SUPPORTED
else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0) else if ((keep = png_chunk_unknown_handling(png_ptr, chunk_name)) != 0)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length, keep); png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length, keep);
if (chunk_name == png_PLTE) if (chunk_name == png_PLTE)
@ -290,11 +277,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
else if (chunk_name == png_PLTE) else if (chunk_name == png_PLTE)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length); png_handle_PLTE(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -313,12 +296,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_gAMA_SUPPORTED #ifdef PNG_READ_gAMA_SUPPORTED
else if (png_ptr->chunk_name == png_gAMA) else if (png_ptr->chunk_name == png_gAMA)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length); png_handle_gAMA(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -326,12 +304,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_sBIT_SUPPORTED #ifdef PNG_READ_sBIT_SUPPORTED
else if (png_ptr->chunk_name == png_sBIT) else if (png_ptr->chunk_name == png_sBIT)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length); png_handle_sBIT(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -339,12 +312,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_cHRM_SUPPORTED #ifdef PNG_READ_cHRM_SUPPORTED
else if (png_ptr->chunk_name == png_cHRM) else if (png_ptr->chunk_name == png_cHRM)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length); png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -352,12 +320,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_sRGB_SUPPORTED #ifdef PNG_READ_sRGB_SUPPORTED
else if (chunk_name == png_sRGB) else if (chunk_name == png_sRGB)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length); png_handle_sRGB(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -365,12 +328,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_iCCP_SUPPORTED #ifdef PNG_READ_iCCP_SUPPORTED
else if (png_ptr->chunk_name == png_iCCP) else if (png_ptr->chunk_name == png_iCCP)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length); png_handle_iCCP(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -378,12 +336,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_sPLT_SUPPORTED #ifdef PNG_READ_sPLT_SUPPORTED
else if (chunk_name == png_sPLT) else if (chunk_name == png_sPLT)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length); png_handle_sPLT(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -391,12 +344,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_tRNS_SUPPORTED #ifdef PNG_READ_tRNS_SUPPORTED
else if (chunk_name == png_tRNS) else if (chunk_name == png_tRNS)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length); png_handle_tRNS(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -404,12 +352,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_bKGD_SUPPORTED #ifdef PNG_READ_bKGD_SUPPORTED
else if (chunk_name == png_bKGD) else if (chunk_name == png_bKGD)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length); png_handle_bKGD(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -417,12 +360,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_hIST_SUPPORTED #ifdef PNG_READ_hIST_SUPPORTED
else if (chunk_name == png_hIST) else if (chunk_name == png_hIST)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length); png_handle_hIST(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -430,12 +368,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_pHYs_SUPPORTED #ifdef PNG_READ_pHYs_SUPPORTED
else if (chunk_name == png_pHYs) else if (chunk_name == png_pHYs)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_pHYs(png_ptr, info_ptr, png_ptr->push_length); png_handle_pHYs(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -443,12 +376,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_oFFs_SUPPORTED #ifdef PNG_READ_oFFs_SUPPORTED
else if (chunk_name == png_oFFs) else if (chunk_name == png_oFFs)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length); png_handle_oFFs(png_ptr, info_ptr, png_ptr->push_length);
} }
#endif #endif
@ -456,12 +384,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_pCAL_SUPPORTED #ifdef PNG_READ_pCAL_SUPPORTED
else if (chunk_name == png_pCAL) else if (chunk_name == png_pCAL)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length); png_handle_pCAL(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -469,12 +392,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_sCAL_SUPPORTED #ifdef PNG_READ_sCAL_SUPPORTED
else if (chunk_name == png_sCAL) else if (chunk_name == png_sCAL)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length); png_handle_sCAL(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -482,12 +400,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_tIME_SUPPORTED #ifdef PNG_READ_tIME_SUPPORTED
else if (chunk_name == png_tIME) else if (chunk_name == png_tIME)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length); png_handle_tIME(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -495,12 +408,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_tEXt_SUPPORTED #ifdef PNG_READ_tEXt_SUPPORTED
else if (chunk_name == png_tEXt) else if (chunk_name == png_tEXt)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length); png_handle_tEXt(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -508,12 +416,7 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_zTXt_SUPPORTED #ifdef PNG_READ_zTXt_SUPPORTED
else if (chunk_name == png_zTXt) else if (chunk_name == png_zTXt)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length); png_handle_zTXt(png_ptr, info_ptr, png_ptr->push_length);
} }
@ -521,23 +424,14 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_iTXt_SUPPORTED #ifdef PNG_READ_iTXt_SUPPORTED
else if (chunk_name == png_iTXt) else if (chunk_name == png_iTXt)
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length); png_handle_iTXt(png_ptr, info_ptr, png_ptr->push_length);
} }
#endif #endif
else else
{ {
if (png_ptr->push_length + 4 > png_ptr->buffer_size) PNG_PUSH_SAVE_BUFFER_IF_FULL
{
png_push_save_buffer(png_ptr);
return;
}
png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length, png_handle_unknown(png_ptr, info_ptr, png_ptr->push_length,
PNG_HANDLE_CHUNK_AS_DEFAULT); PNG_HANDLE_CHUNK_AS_DEFAULT);
} }
@ -602,12 +496,7 @@ png_push_crc_finish(png_structrp png_ptr)
} }
if (!png_ptr->skip_length) if (!png_ptr->skip_length)
{ {
if (png_ptr->buffer_size < 4) PNG_PUSH_SAVE_BUFFER_IF_LT(4)
{
png_push_save_buffer(png_ptr);
return;
}
png_crc_finish(png_ptr, 0); png_crc_finish(png_ptr, 0);
png_ptr->process_mode = PNG_READ_CHUNK_MODE; png_ptr->process_mode = PNG_READ_CHUNK_MODE;
} }
@ -732,12 +621,7 @@ png_push_read_IDAT(png_structrp png_ptr)
png_byte chunk_tag[4]; png_byte chunk_tag[4];
/* TODO: this code can be commoned up with the same code in push_read */ /* TODO: this code can be commoned up with the same code in push_read */
if (png_ptr->buffer_size < 8) PNG_PUSH_SAVE_BUFFER_IF_LT(8)
{
png_push_save_buffer(png_ptr);
return;
}
png_push_fill_buffer(png_ptr, chunk_length, 4); png_push_fill_buffer(png_ptr, chunk_length, 4);
png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length); png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length);
png_reset_crc(png_ptr); png_reset_crc(png_ptr);
@ -812,12 +696,7 @@ png_push_read_IDAT(png_structrp png_ptr)
} }
if (!png_ptr->idat_size) if (!png_ptr->idat_size)
{ {
if (png_ptr->buffer_size < 4) PNG_PUSH_SAVE_BUFFER_IF_LT(4)
{
png_push_save_buffer(png_ptr);
return;
}
png_crc_finish(png_ptr, 0); png_crc_finish(png_ptr, 0);
png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER; png_ptr->mode &= ~PNG_HAVE_CHUNK_HEADER;
png_ptr->mode |= PNG_AFTER_IDAT; png_ptr->mode |= PNG_AFTER_IDAT;

View File

@ -119,8 +119,12 @@
* PNG_ARM_NEON_OPT is set in CPPFLAGS (to >0) then arm/arm_init.c will fail * PNG_ARM_NEON_OPT is set in CPPFLAGS (to >0) then arm/arm_init.c will fail
* to compile with an appropriate #error if ALIGNED_MEMORY has been turned * to compile with an appropriate #error if ALIGNED_MEMORY has been turned
* off. * off.
*
* Note that gcc-4.9 defines __ARM_NEON instead of __ARM_NEON__, so we
* check both variants.
*/ */
# if defined(__ARM_NEON__) && defined(PNG_ALIGNED_MEMORY_SUPPORTED) # if (defined(__ARM_NEON__) || defined(__ARM_NEON)) && \
defined(PNG_ALIGNED_MEMORY_SUPPORTED)
# define PNG_ARM_NEON_OPT 2 # define PNG_ARM_NEON_OPT 2
# else # else
# define PNG_ARM_NEON_OPT 0 # define PNG_ARM_NEON_OPT 0
@ -148,7 +152,7 @@
* libpng implementation list for incorporation in the next minor release. * libpng implementation list for incorporation in the next minor release.
*/ */
# ifndef PNG_ARM_NEON_IMPLEMENTATION # ifndef PNG_ARM_NEON_IMPLEMENTATION
# ifdef __ARM_NEON__ # if defined(__ARM_NEON__) || defined(__ARM_NEON)
# if defined(__clang__) # if defined(__clang__)
/* At present it is unknown by the libpng developers which versions /* At present it is unknown by the libpng developers which versions
* of clang support the intrinsics, however some or perhaps all * of clang support the intrinsics, however some or perhaps all
@ -1086,7 +1090,7 @@ PNG_INTERNAL_FUNCTION(void,png_write_tEXt,(png_structrp png_ptr,
#ifdef PNG_WRITE_zTXt_SUPPORTED #ifdef PNG_WRITE_zTXt_SUPPORTED
PNG_INTERNAL_FUNCTION(void,png_write_zTXt,(png_structrp png_ptr, png_const_charp PNG_INTERNAL_FUNCTION(void,png_write_zTXt,(png_structrp png_ptr, png_const_charp
key, png_const_charp text, png_size_t text_len, int compression),PNG_EMPTY); key, png_const_charp text, int compression),PNG_EMPTY);
#endif #endif
#ifdef PNG_WRITE_iTXt_SUPPORTED #ifdef PNG_WRITE_iTXt_SUPPORTED

View File

@ -1,7 +1,7 @@
/* pngread.c - read a PNG file /* pngread.c - read a PNG file
* *
* Last changed in libpng 1.6.11 [June 12, 2014] * Last changed in libpng 1.6.11 [June 5, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -396,6 +396,7 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
row_info.pixel_depth = png_ptr->pixel_depth; row_info.pixel_depth = png_ptr->pixel_depth;
row_info.rowbytes = PNG_ROWBYTES(row_info.pixel_depth, row_info.width); row_info.rowbytes = PNG_ROWBYTES(row_info.pixel_depth, row_info.width);
#ifdef PNG_WARNINGS_SUPPORTED
if (png_ptr->row_number == 0 && png_ptr->pass == 0) if (png_ptr->row_number == 0 && png_ptr->pass == 0)
{ {
/* Check for transforms that have been set but were defined out */ /* Check for transforms that have been set but were defined out */
@ -435,6 +436,7 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
png_warning(png_ptr, "PNG_READ_SWAP_SUPPORTED is not defined"); png_warning(png_ptr, "PNG_READ_SWAP_SUPPORTED is not defined");
#endif #endif
} }
#endif /* PNG_WARNINGS_SUPPORTED */
#ifdef PNG_READ_INTERLACING_SUPPORTED #ifdef PNG_READ_INTERLACING_SUPPORTED
/* If interlaced and we do not need a new row, combine row and return. /* If interlaced and we do not need a new row, combine row and return.
@ -945,7 +947,7 @@ png_read_destroy(png_structrp png_ptr)
png_free(png_ptr, png_ptr->save_buffer); png_free(png_ptr, png_ptr->save_buffer);
#endif #endif
#if defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) &&\ #if defined(PNG_STORE_UNKNOWN_CHUNKS_SUPPORTED) && \
defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED) defined(PNG_READ_UNKNOWN_CHUNKS_SUPPORTED)
png_free(png_ptr, png_ptr->unknown_chunk.data); png_free(png_ptr, png_ptr->unknown_chunk.data);
#endif #endif
@ -1220,7 +1222,7 @@ png_read_png(png_structrp png_ptr, png_inforp info_ptr,
# define P_LINEAR8 4 /* 8-bit linear: only from a file value */ # define P_LINEAR8 4 /* 8-bit linear: only from a file value */
/* Color-map processing: after libpng has run on the PNG image further /* Color-map processing: after libpng has run on the PNG image further
* processing may be needed to conver the data to color-map indicies. * processing may be needed to convert the data to color-map indices.
*/ */
#define PNG_CMAP_NONE 0 #define PNG_CMAP_NONE 0
#define PNG_CMAP_GA 1 /* Process GA data to a color-map with alpha */ #define PNG_CMAP_GA 1 /* Process GA data to a color-map with alpha */
@ -2187,7 +2189,7 @@ png_image_read_colormap(png_voidp argument)
data_encoding = P_FILE; data_encoding = P_FILE;
/* The rows from libpng, while technically gray values, are now also /* The rows from libpng, while technically gray values, are now also
* color-map indicies; however, they may need to be expanded to 1 * color-map indices; however, they may need to be expanded to 1
* byte per pixel. This is what png_set_packing does (i.e., it * byte per pixel. This is what png_set_packing does (i.e., it
* unpacks the bit values into bytes.) * unpacks the bit values into bytes.)
*/ */
@ -2273,8 +2275,8 @@ png_image_read_colormap(png_voidp argument)
* 8-bit GA and it has to be processing to single byte color-map * 8-bit GA and it has to be processing to single byte color-map
* values. Entry 254 is replaced by either a completely * values. Entry 254 is replaced by either a completely
* transparent entry or by the background color at full * transparent entry or by the background color at full
* precision (and the background color is not a simple gray leve * precision (and the background color is not a simple gray
* in this case.) * level in this case.)
*/ */
expand_tRNS = 1; expand_tRNS = 1;
output_processing = PNG_CMAP_TRANS; output_processing = PNG_CMAP_TRANS;
@ -2752,7 +2754,7 @@ png_image_read_colormap(png_voidp argument)
num_trans = 0; num_trans = 0;
output_processing = PNG_CMAP_NONE; output_processing = PNG_CMAP_NONE;
data_encoding = P_FILE; /* Don't change from color-map indicies */ data_encoding = P_FILE; /* Don't change from color-map indices */
cmap_entries = png_ptr->num_palette; cmap_entries = png_ptr->num_palette;
if (cmap_entries > 256) if (cmap_entries > 256)
cmap_entries = 256; cmap_entries = 256;
@ -2792,7 +2794,7 @@ png_image_read_colormap(png_voidp argument)
i < num_trans ? trans[i] : 255U, P_FILE/*8-bit*/); i < num_trans ? trans[i] : 255U, P_FILE/*8-bit*/);
} }
/* The PNG data may have indicies packed in fewer than 8 bits, it /* The PNG data may have indices packed in fewer than 8 bits, it
* must be expanded if so. * must be expanded if so.
*/ */
if (png_ptr->bit_depth < 8) if (png_ptr->bit_depth < 8)

View File

@ -1,7 +1,7 @@
/* pngrtran.c - transforms the data in a row for PNG readers /* pngrtran.c - transforms the data in a row for PNG readers
* *
* Last changed in libpng 1.6.11 [June 12, 2014] * Last changed in libpng 1.6.11 [June 5, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -959,7 +959,7 @@ png_set_rgb_to_gray_fixed(png_structrp png_ptr, int error_action,
if (!png_rtran_ok(png_ptr, 1)) if (!png_rtran_ok(png_ptr, 1))
return; return;
switch(error_action) switch (error_action)
{ {
case PNG_ERROR_ACTION_NONE: case PNG_ERROR_ACTION_NONE:
png_ptr->transformations |= PNG_RGB_TO_GRAY; png_ptr->transformations |= PNG_RGB_TO_GRAY;

View File

@ -1,7 +1,7 @@
/* pngrutil.c - utilities to read a PNG file /* pngrutil.c - utilities to read a PNG file
* *
* Last changed in libpng 1.6.11 [June 12, 2014] * Last changed in libpng 1.6.14 [October 23, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -341,12 +341,12 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
* are minimal. * are minimal.
*/ */
(void)png_safecat(msg, (sizeof msg), 4, " using zstream"); (void)png_safecat(msg, (sizeof msg), 4, " using zstream");
# if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC #if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC
png_chunk_warning(png_ptr, msg); png_chunk_warning(png_ptr, msg);
png_ptr->zowner = 0; png_ptr->zowner = 0;
# else #else
png_chunk_error(png_ptr, msg); png_chunk_error(png_ptr, msg);
# endif #endif
} }
/* Implementation note: unlike 'png_deflate_claim' this internal function /* Implementation note: unlike 'png_deflate_claim' this internal function
@ -364,22 +364,21 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
*/ */
{ {
int ret; /* zlib return code */ int ret; /* zlib return code */
# if PNG_ZLIB_VERNUM >= 0x1240 #if PNG_ZLIB_VERNUM >= 0x1240
# if defined(PNG_SET_OPTION_SUPPORTED) && \ # if defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_MAXIMUM_INFLATE_WINDOW)
defined(PNG_MAXIMUM_INFLATE_WINDOW) int window_bits;
int window_bits;
if (((png_ptr->options >> PNG_MAXIMUM_INFLATE_WINDOW) & 3) == if (((png_ptr->options >> PNG_MAXIMUM_INFLATE_WINDOW) & 3) ==
PNG_OPTION_ON) PNG_OPTION_ON)
window_bits = 15; window_bits = 15;
else else
window_bits = 0; window_bits = 0;
# else # else
# define window_bits 0 # define window_bits 0
# endif # endif
# endif #endif
/* Set this for safety, just in case the previous owner left pointers to /* Set this for safety, just in case the previous owner left pointers to
* memory allocations. * memory allocations.
@ -391,20 +390,20 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
if (png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED) if (png_ptr->flags & PNG_FLAG_ZSTREAM_INITIALIZED)
{ {
# if PNG_ZLIB_VERNUM < 0x1240 #if PNG_ZLIB_VERNUM < 0x1240
ret = inflateReset(&png_ptr->zstream); ret = inflateReset(&png_ptr->zstream);
# else #else
ret = inflateReset2(&png_ptr->zstream, window_bits); ret = inflateReset2(&png_ptr->zstream, window_bits);
# endif #endif
} }
else else
{ {
# if PNG_ZLIB_VERNUM < 0x1240 #if PNG_ZLIB_VERNUM < 0x1240
ret = inflateInit(&png_ptr->zstream); ret = inflateInit(&png_ptr->zstream);
# else #else
ret = inflateInit2(&png_ptr->zstream, window_bits); ret = inflateInit2(&png_ptr->zstream, window_bits);
# endif #endif
if (ret == Z_OK) if (ret == Z_OK)
png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED; png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED;
@ -419,9 +418,9 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
return ret; return ret;
} }
# ifdef window_bits #ifdef window_bits
# undef window_bits # undef window_bits
# endif #endif
} }
#ifdef PNG_READ_COMPRESSED_TEXT_SUPPORTED #ifdef PNG_READ_COMPRESSED_TEXT_SUPPORTED
@ -518,7 +517,7 @@ png_inflate(png_structrp png_ptr, png_uint_32 owner, int finish,
* end of the output buffer. * end of the output buffer.
*/ */
ret = inflate(&png_ptr->zstream, avail_out > 0 ? Z_NO_FLUSH : ret = inflate(&png_ptr->zstream, avail_out > 0 ? Z_NO_FLUSH :
(finish ? Z_FINISH : Z_SYNC_FLUSH)); (finish ? Z_FINISH : Z_SYNC_FLUSH));
} while (ret == Z_OK); } while (ret == Z_OK);
/* For safety kill the local buffer pointer now */ /* For safety kill the local buffer pointer now */
@ -576,14 +575,14 @@ png_decompress_chunk(png_structrp png_ptr,
*/ */
png_alloc_size_t limit = PNG_SIZE_MAX; png_alloc_size_t limit = PNG_SIZE_MAX;
# ifdef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED # ifdef PNG_SET_CHUNK_MALLOC_LIMIT_SUPPORTED
if (png_ptr->user_chunk_malloc_max > 0 && if (png_ptr->user_chunk_malloc_max > 0 &&
png_ptr->user_chunk_malloc_max < limit) png_ptr->user_chunk_malloc_max < limit)
limit = png_ptr->user_chunk_malloc_max; limit = png_ptr->user_chunk_malloc_max;
# elif PNG_USER_CHUNK_MALLOC_MAX > 0 # elif PNG_USER_CHUNK_MALLOC_MAX > 0
if (PNG_USER_CHUNK_MALLOC_MAX < limit) if (PNG_USER_CHUNK_MALLOC_MAX < limit)
limit = PNG_USER_CHUNK_MALLOC_MAX; limit = PNG_USER_CHUNK_MALLOC_MAX;
# endif # endif
if (limit >= prefix_size + (terminate != 0)) if (limit >= prefix_size + (terminate != 0))
{ {
@ -1011,7 +1010,7 @@ png_handle_PLTE(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
*/ */
#ifdef PNG_READ_tRNS_SUPPORTED #ifdef PNG_READ_tRNS_SUPPORTED
if (png_ptr->num_trans > 0 || if (png_ptr->num_trans > 0 ||
(info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS) != 0)) (info_ptr != NULL && (info_ptr->valid & PNG_INFO_tRNS) != 0))
{ {
/* Cancel this because otherwise it would be used if the transforms /* Cancel this because otherwise it would be used if the transforms
* require it. Don't cancel the 'valid' flag because this would prevent * require it. Don't cancel the 'valid' flag because this would prevent
@ -1319,9 +1318,9 @@ png_handle_iCCP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
* chunk is just ignored, so does not invalidate the color space. An * chunk is just ignored, so does not invalidate the color space. An
* alternative is to set the 'invalid' flags at the start of this routine * alternative is to set the 'invalid' flags at the start of this routine
* and only clear them in they were not set before and all the tests pass. * and only clear them in they were not set before and all the tests pass.
* The minimum 'deflate' stream is assumed to be just the 2 byte header and 4 * The minimum 'deflate' stream is assumed to be just the 2 byte header and
* byte checksum. The keyword must be one character and there is a * 4 byte checksum. The keyword must be at least one character and there is
* terminator (0) byte and the compression method. * a terminator (0) byte and the compression method.
*/ */
if (length < 9) if (length < 9)
{ {
@ -2640,7 +2639,7 @@ png_handle_iTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
/* prefix_length should now be at the trailing '\0' of the translated /* prefix_length should now be at the trailing '\0' of the translated
* keyword, but it may already be over the end. None of this arithmetic * keyword, but it may already be over the end. None of this arithmetic
* can overflow because chunks are at most 2^31 bytes long, but on 16-bit * can overflow because chunks are at most 2^31 bytes long, but on 16-bit
* systems the available allocaton may overflow. * systems the available allocation may overflow.
*/ */
++prefix_length; ++prefix_length;
@ -2672,7 +2671,7 @@ png_handle_iTXt(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length)
buffer[uncompressed_length+prefix_length] = 0; buffer[uncompressed_length+prefix_length] = 0;
if (compressed != 0) if (compressed == 0)
text.compression = PNG_ITXT_COMPRESSION_NONE; text.compression = PNG_ITXT_COMPRESSION_NONE;
else else
@ -3331,7 +3330,7 @@ png_combine_row(png_const_structrp png_ptr, png_bytep dp, int display)
/* This can only be the RGB case, so each copy is exactly one /* This can only be the RGB case, so each copy is exactly one
* pixel and it is not necessary to check for a partial copy. * pixel and it is not necessary to check for a partial copy.
*/ */
for(;;) for (;;)
{ {
dp[0] = sp[0], dp[1] = sp[1], dp[2] = sp[2]; dp[0] = sp[0], dp[1] = sp[1], dp[2] = sp[2];

View File

@ -1,7 +1,7 @@
/* pngset.c - storage of image information into info struct /* pngset.c - storage of image information into info struct
* *
* Last changed in libpng 1.6.11 [June 12, 2014] * Last changed in libpng 1.6.11 [June 5, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -726,7 +726,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr,
else else
max_text = INT_MAX; max_text = INT_MAX;
/* Now allocate a new array and copy the old members in, this does all /* Now allocate a new array and copy the old members in; this does all
* the overflow checks. * the overflow checks.
*/ */
new_text = png_voidcast(png_textp,png_realloc_array(png_ptr, new_text = png_voidcast(png_textp,png_realloc_array(png_ptr,
@ -1020,8 +1020,8 @@ png_set_sPLT(png_const_structrp png_ptr,
np->depth = entries->depth; np->depth = entries->depth;
/* In the even of out-of-memory just return - there's no point keeping on /* In the event of out-of-memory just return - there's no point keeping
* trying to add sPLT chunks. * on trying to add sPLT chunks.
*/ */
length = strlen(entries->name) + 1; length = strlen(entries->name) + 1;
np->name = png_voidcast(png_charp, png_malloc_base(png_ptr, length)); np->name = png_voidcast(png_charp, png_malloc_base(png_ptr, length));
@ -1032,8 +1032,8 @@ png_set_sPLT(png_const_structrp png_ptr,
memcpy(np->name, entries->name, length); memcpy(np->name, entries->name, length);
/* IMPORTANT: we have memory now that won't get freed if something else /* IMPORTANT: we have memory now that won't get freed if something else
* goes wrong, this code must free it. png_malloc_array produces no * goes wrong; this code must free it. png_malloc_array produces no
* warnings, use a png_chunk_report (below) if there is an error. * warnings; use a png_chunk_report (below) if there is an error.
*/ */
np->entries = png_voidcast(png_sPLT_entryp, png_malloc_array(png_ptr, np->entries = png_voidcast(png_sPLT_entryp, png_malloc_array(png_ptr,
entries->nentries, sizeof (png_sPLT_entry))); entries->nentries, sizeof (png_sPLT_entry)));
@ -1072,7 +1072,7 @@ check_location(png_const_structrp png_ptr, int location)
location &= (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT); location &= (PNG_HAVE_IHDR|PNG_HAVE_PLTE|PNG_AFTER_IDAT);
/* New in 1.6.0; copy the location and check it. This is an API /* New in 1.6.0; copy the location and check it. This is an API
* change, previously the app had to use the * change; previously the app had to use the
* png_set_unknown_chunk_location API below for each chunk. * png_set_unknown_chunk_location API below for each chunk.
*/ */
if (location == 0 && !(png_ptr->mode & PNG_IS_READ_STRUCT)) if (location == 0 && !(png_ptr->mode & PNG_IS_READ_STRUCT))
@ -1578,7 +1578,7 @@ png_set_benign_errors(png_structrp png_ptr, int allowed)
* It is possible for an indexed (color-type==3) PNG file to contain * It is possible for an indexed (color-type==3) PNG file to contain
* pixels with invalid (out-of-range) indexes if the PLTE chunk has * pixels with invalid (out-of-range) indexes if the PLTE chunk has
* fewer entries than the image's bit-depth would allow. We recover * fewer entries than the image's bit-depth would allow. We recover
* from this gracefully by filling any incomplete palette with zeroes * from this gracefully by filling any incomplete palette with zeros
* (opaque black). By default, when this occurs libpng will issue * (opaque black). By default, when this occurs libpng will issue
* a benign error. This API can be used to override that behavior. * a benign error. This API can be used to override that behavior.
*/ */

View File

@ -1,7 +1,7 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers) /* pngtrans.c - transforms the data in a row (used by both readers and writers)
* *
* Last changed in libpng 1.6.11 [June 12, 2014] * Last changed in libpng 1.6.11 [June 5, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -828,7 +828,7 @@ png_get_user_transform_ptr(png_const_structrp png_ptr)
png_uint_32 PNGAPI png_uint_32 PNGAPI
png_get_current_row_number(png_const_structrp png_ptr) png_get_current_row_number(png_const_structrp png_ptr)
{ {
/* See the comments in png.h - this is the sub-image row when reading and /* See the comments in png.h - this is the sub-image row when reading an
* interlaced image. * interlaced image.
*/ */
if (png_ptr != NULL) if (png_ptr != NULL)

View File

@ -1,7 +1,7 @@
/* pngwrite.c - general routines to write a PNG file /* pngwrite.c - general routines to write a PNG file
* *
* Last changed in libpng 1.6.11 [June 12, 2014] * Last changed in libpng 1.6.14 [October 23, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -292,11 +292,14 @@ png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
info_ptr->text[i].lang, info_ptr->text[i].lang,
info_ptr->text[i].lang_key, info_ptr->text[i].lang_key,
info_ptr->text[i].text); info_ptr->text[i].text);
/* Mark this chunk as written */
if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
else
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
#else #else
png_warning(png_ptr, "Unable to write international text"); png_warning(png_ptr, "Unable to write international text");
#endif #endif
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
} }
/* If we want a compressed text chunk */ /* If we want a compressed text chunk */
@ -305,13 +308,12 @@ png_write_info(png_structrp png_ptr, png_const_inforp info_ptr)
#ifdef PNG_WRITE_zTXt_SUPPORTED #ifdef PNG_WRITE_zTXt_SUPPORTED
/* Write compressed chunk */ /* Write compressed chunk */
png_write_zTXt(png_ptr, info_ptr->text[i].key, png_write_zTXt(png_ptr, info_ptr->text[i].key,
info_ptr->text[i].text, 0, info_ptr->text[i].text, info_ptr->text[i].compression);
info_ptr->text[i].compression); /* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
#else #else
png_warning(png_ptr, "Unable to write compressed text"); png_warning(png_ptr, "Unable to write compressed text");
#endif #endif
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
} }
else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE) else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
@ -387,11 +389,14 @@ png_write_end(png_structrp png_ptr, png_inforp info_ptr)
info_ptr->text[i].lang, info_ptr->text[i].lang,
info_ptr->text[i].lang_key, info_ptr->text[i].lang_key,
info_ptr->text[i].text); info_ptr->text[i].text);
/* Mark this chunk as written */
if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
else
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
#else #else
png_warning(png_ptr, "Unable to write international text"); png_warning(png_ptr, "Unable to write international text");
#endif #endif
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
} }
else if (info_ptr->text[i].compression >= PNG_TEXT_COMPRESSION_zTXt) else if (info_ptr->text[i].compression >= PNG_TEXT_COMPRESSION_zTXt)
@ -399,13 +404,12 @@ png_write_end(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_WRITE_zTXt_SUPPORTED #ifdef PNG_WRITE_zTXt_SUPPORTED
/* Write compressed chunk */ /* Write compressed chunk */
png_write_zTXt(png_ptr, info_ptr->text[i].key, png_write_zTXt(png_ptr, info_ptr->text[i].key,
info_ptr->text[i].text, 0, info_ptr->text[i].text, info_ptr->text[i].compression);
info_ptr->text[i].compression); /* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
#else #else
png_warning(png_ptr, "Unable to write compressed text"); png_warning(png_ptr, "Unable to write compressed text");
#endif #endif
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_zTXt_WR;
} }
else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE) else if (info_ptr->text[i].compression == PNG_TEXT_COMPRESSION_NONE)
@ -414,12 +418,11 @@ png_write_end(png_structrp png_ptr, png_inforp info_ptr)
/* Write uncompressed chunk */ /* Write uncompressed chunk */
png_write_tEXt(png_ptr, info_ptr->text[i].key, png_write_tEXt(png_ptr, info_ptr->text[i].key,
info_ptr->text[i].text, 0); info_ptr->text[i].text, 0);
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
#else #else
png_warning(png_ptr, "Unable to write uncompressed text"); png_warning(png_ptr, "Unable to write uncompressed text");
#endif #endif
/* Mark this chunk as written */
info_ptr->text[i].compression = PNG_TEXT_COMPRESSION_NONE_WR;
} }
} }
#endif #endif

View File

@ -1,7 +1,7 @@
/* pngwutil.c - utilities to write a PNG file /* pngwutil.c - utilities to write a PNG file
* *
* Last changed in libpng 1.6.11 [June 12, 2014] * Last changed in libpng 1.6.14 [October 23, 2014]
* Copyright (c) 1998-2014 Glenn Randers-Pehrson * Copyright (c) 1998-2014 Glenn Randers-Pehrson
* (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger) * (Version 0.96 Copyright (c) 1996, 1997 Andreas Dilger)
* (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.) * (Version 0.88 Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
@ -136,7 +136,7 @@ png_write_chunk_data(png_structrp png_ptr, png_const_bytep data,
png_write_data(png_ptr, data, length); png_write_data(png_ptr, data, length);
/* Update the CRC after writing the data, /* Update the CRC after writing the data,
* in case that the user I/O routine alters it. * in case the user I/O routine alters it.
*/ */
png_calculate_crc(png_ptr, data, length); png_calculate_crc(png_ptr, data, length);
} }
@ -181,7 +181,7 @@ png_write_complete_chunk(png_structrp png_ptr, png_uint_32 chunk_name,
/* On 64 bit architectures 'length' may not fit in a png_uint_32. */ /* On 64 bit architectures 'length' may not fit in a png_uint_32. */
if (length > PNG_UINT_31_MAX) if (length > PNG_UINT_31_MAX)
png_error(png_ptr, "length exceeds PNG maxima"); png_error(png_ptr, "length exceeds PNG maximum");
png_write_chunk_header(png_ptr, chunk_name, (png_uint_32)length); png_write_chunk_header(png_ptr, chunk_name, (png_uint_32)length);
png_write_chunk_data(png_ptr, data, length); png_write_chunk_data(png_ptr, data, length);
@ -204,7 +204,7 @@ png_write_chunk(png_structrp png_ptr, png_const_bytep chunk_string,
static png_alloc_size_t static png_alloc_size_t
png_image_size(png_structrp png_ptr) png_image_size(png_structrp png_ptr)
{ {
/* Only return sizes up to the maximum of a png_uint_32, do this by limiting /* Only return sizes up to the maximum of a png_uint_32; do this by limiting
* the width and height used to 15 bits. * the width and height used to 15 bits.
*/ */
png_uint_32 h = png_ptr->height; png_uint_32 h = png_ptr->height;
@ -297,6 +297,7 @@ png_deflate_claim(png_structrp png_ptr, png_uint_32 owner,
{ {
if (png_ptr->zowner != 0) if (png_ptr->zowner != 0)
{ {
# if defined(PNG_WARNINGS_SUPPORTED) || defined(PNG_ERROR_TEXT_SUPPORTED)
char msg[64]; char msg[64];
PNG_STRING_FROM_CHUNK(msg, owner); PNG_STRING_FROM_CHUNK(msg, owner);
@ -308,6 +309,7 @@ png_deflate_claim(png_structrp png_ptr, png_uint_32 owner,
* are minimal. * are minimal.
*/ */
(void)png_safecat(msg, (sizeof msg), 10, " using zstream"); (void)png_safecat(msg, (sizeof msg), 10, " using zstream");
# endif
# if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC # if PNG_LIBPNG_BUILD_BASE_TYPE >= PNG_LIBPNG_BUILD_RC
png_warning(png_ptr, msg); png_warning(png_ptr, msg);
@ -492,7 +494,7 @@ png_text_compress(png_structrp png_ptr, png_uint_32 chunk_name,
int ret; int ret;
/* To find the length of the output it is necessary to first compress the /* To find the length of the output it is necessary to first compress the
* input, the result is buffered rather than using the two-pass algorithm * input. The result is buffered rather than using the two-pass algorithm
* that is used on the inflate side; deflate is assumed to be slower and a * that is used on the inflate side; deflate is assumed to be slower and a
* PNG writer is assumed to have more memory available than a PNG reader. * PNG writer is assumed to have more memory available than a PNG reader.
* *
@ -589,7 +591,7 @@ png_text_compress(png_structrp png_ptr, png_uint_32 chunk_name,
} }
while (ret == Z_OK); while (ret == Z_OK);
/* There may be some space left in the last output buffer, this needs to /* There may be some space left in the last output buffer. This needs to
* be subtracted from output_len. * be subtracted from output_len.
*/ */
output_len -= png_ptr->zstream.avail_out; output_len -= png_ptr->zstream.avail_out;
@ -612,7 +614,7 @@ png_text_compress(png_structrp png_ptr, png_uint_32 chunk_name,
/* Reset zlib for another zTXt/iTXt or image data */ /* Reset zlib for another zTXt/iTXt or image data */
png_ptr->zowner = 0; png_ptr->zowner = 0;
/* The only success case is Z_STREAM_END, input_len must be 0, if not this /* The only success case is Z_STREAM_END, input_len must be 0; if not this
* is an internal error. * is an internal error.
*/ */
if (ret == Z_STREAM_END && input_len == 0) if (ret == Z_STREAM_END && input_len == 0)
@ -728,6 +730,7 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
if (key_len == 0) if (key_len == 0)
return 0; return 0;
#ifdef PNG_WARNINGS_SUPPORTED
/* Try to only output one warning per keyword: */ /* Try to only output one warning per keyword: */
if (*key) /* keyword too long */ if (*key) /* keyword too long */
png_warning(png_ptr, "keyword truncated"); png_warning(png_ptr, "keyword truncated");
@ -741,6 +744,7 @@ png_check_keyword(png_structrp png_ptr, png_const_charp key, png_bytep new_key)
png_formatted_warning(png_ptr, p, "keyword \"@1\": bad character '0x@2'"); png_formatted_warning(png_ptr, p, "keyword \"@1\": bad character '0x@2'");
} }
#endif /* PNG_WARNINGS_SUPPORTED */
return key_len; return key_len;
} }
@ -998,7 +1002,7 @@ png_write_PLTE(png_structrp png_ptr, png_const_colorp palette,
* Z_FINISH: this is the end of the input, do a Z_FINISH and clean up * Z_FINISH: this is the end of the input, do a Z_FINISH and clean up
* *
* The routine manages the acquire and release of the png_ptr->zstream by * The routine manages the acquire and release of the png_ptr->zstream by
* checking and (at the end) clearing png_ptr->zowner, it does some sanity * checking and (at the end) clearing png_ptr->zowner; it does some sanity
* checks on the 'mode' flags while doing this. * checks on the 'mode' flags while doing this.
*/ */
void /* PRIVATE */ void /* PRIVATE */
@ -1058,7 +1062,7 @@ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input,
input_len += png_ptr->zstream.avail_in; input_len += png_ptr->zstream.avail_in;
png_ptr->zstream.avail_in = 0; png_ptr->zstream.avail_in = 0;
/* OUTPUT: write complete IDAT chunks when avail_out drops to zero, note /* OUTPUT: write complete IDAT chunks when avail_out drops to zero. Note
* that these two zstream fields are preserved across the calls, therefore * that these two zstream fields are preserved across the calls, therefore
* there is no need to set these up on entry to the loop. * there is no need to set these up on entry to the loop.
*/ */
@ -1090,7 +1094,7 @@ png_compress_IDAT(png_structrp png_ptr, png_const_bytep input,
continue; continue;
} }
/* The order of these checks doesn't matter much; it just effect which /* The order of these checks doesn't matter much; it just affects which
* possible error might be detected if multiple things go wrong at once. * possible error might be detected if multiple things go wrong at once.
*/ */
if (ret == Z_OK) /* most likely return code! */ if (ret == Z_OK) /* most likely return code! */
@ -1621,14 +1625,13 @@ png_write_tEXt(png_structrp png_ptr, png_const_charp key, png_const_charp text,
/* Write a compressed text chunk */ /* Write a compressed text chunk */
void /* PRIVATE */ void /* PRIVATE */
png_write_zTXt(png_structrp png_ptr, png_const_charp key, png_const_charp text, png_write_zTXt(png_structrp png_ptr, png_const_charp key, png_const_charp text,
png_size_t text_len, int compression) int compression)
{ {
png_uint_32 key_len; png_uint_32 key_len;
png_byte new_key[81]; png_byte new_key[81];
compression_state comp; compression_state comp;
png_debug(1, "in png_write_zTXt"); png_debug(1, "in png_write_zTXt");
PNG_UNUSED(text_len) /* Always use strlen */
if (compression == PNG_TEXT_COMPRESSION_NONE) if (compression == PNG_TEXT_COMPRESSION_NONE)
{ {

View File

@ -53,7 +53,7 @@
<key>CFBundleSignature</key> <key>CFBundleSignature</key>
<string>StLa</string> <string>StLa</string>
<key>CFBundleVersion</key> <key>CFBundleVersion</key>
<string>4.2</string> <string>4.5</string>
<key>LSMinimumSystemVersionByArchitecture</key> <key>LSMinimumSystemVersionByArchitecture</key>
<dict> <dict>
<key>i386</key> <key>i386</key>

View File

@ -1,5 +1,5 @@
%define name stella %define name stella
%define version 4.2 %define version 4.5
%define rel 1 %define rel 1
%define enable_sound 1 %define enable_sound 1
@ -101,6 +101,9 @@ rm -rf $RPM_BUILD_DIR/%{name}-%{version}
%_datadir/icons/large/%{name}.png %_datadir/icons/large/%{name}.png
%changelog %changelog
* xxx Dec xx 2014 Stephen Anthony <stephena@users.sf.net> 4.5-1
- Version 4.5 release
* Tue Oct 28 2014 Stephen Anthony <stephena@users.sf.net> 4.2-1 * Tue Oct 28 2014 Stephen Anthony <stephena@users.sf.net> 4.2-1
- Version 4.2 release - Version 4.2 release

View File

@ -36,8 +36,8 @@ IDI_ICON ICON "stella.ico"
// //
VS_VERSION_INFO VERSIONINFO VS_VERSION_INFO VERSIONINFO
FILEVERSION 4,2,0,0 FILEVERSION 4,5,0,0
PRODUCTVERSION 4,2,0,0 PRODUCTVERSION 4,5,0,0
FILEFLAGSMASK 0x3fL FILEFLAGSMASK 0x3fL
#ifdef _DEBUG #ifdef _DEBUG
FILEFLAGS 0x1L FILEFLAGS 0x1L
@ -55,12 +55,12 @@ BEGIN
VALUE "Comments", "The multi-platform Atari 2600 emulator. Stella is released under the GPLv2." VALUE "Comments", "The multi-platform Atari 2600 emulator. Stella is released under the GPLv2."
VALUE "CompanyName", "The Stella Team (http://stella.sourceforge.net)" VALUE "CompanyName", "The Stella Team (http://stella.sourceforge.net)"
VALUE "FileDescription", "Stella" VALUE "FileDescription", "Stella"
VALUE "FileVersion", "4.2" VALUE "FileVersion", "4.5"
VALUE "InternalName", "Stella" VALUE "InternalName", "Stella"
VALUE "LegalCopyright", "Copyright (C) 1995-2014 The Stella Team" VALUE "LegalCopyright", "Copyright (C) 1995-2014 The Stella Team"
VALUE "OriginalFilename", "Stella.exe" VALUE "OriginalFilename", "Stella.exe"
VALUE "ProductName", "Stella" VALUE "ProductName", "Stella"
VALUE "ProductVersion", "4.2" VALUE "ProductVersion", "4.5"
END END
END END
BLOCK "VarFileInfo" BLOCK "VarFileInfo"