Skip to content

Commit

Permalink
8316030: Update Libpng to 1.6.40
Browse files Browse the repository at this point in the history
Backport-of: 158293d
  • Loading branch information
rajamah authored and aivanov-jdk committed Nov 15, 2023
1 parent dfca3b9 commit 015dab9
Show file tree
Hide file tree
Showing 11 changed files with 164 additions and 157 deletions.
8 changes: 5 additions & 3 deletions src/java.desktop/share/legal/libpng.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## libpng v1.6.39
## libpng v1.6.40

### libpng License
<pre>
Expand All @@ -9,8 +9,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
PNG Reference Library License version 2
---------------------------------------

Copyright (c) 1995-2022 The PNG Reference Library Authors.
Copyright (c) 2018-2022 Cosmin Truta
Copyright (c) 1995-2023 The PNG Reference Library Authors.
Copyright (c) 2018-2023 Cosmin Truta
Copyright (c) 1998-2018 Glenn Randers-Pehrson
Copyright (c) 1996-1997 Andreas Dilger
Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
Expand Down Expand Up @@ -175,6 +175,7 @@ Authors, for copyright and licensing purposes.
* Mike Klein
* Pascal Massimino
* Paul Schmidt
* Philippe Antoine
* Qiang Zhou
* Sam Bushell
* Samuel Williams
Expand All @@ -193,6 +194,7 @@ Authors, for copyright and licensing purposes.
- Matt Sarett
- Mike Klein
- Sami Boukortt
- Wan-Teh Chang
The build projects, the build scripts, the test scripts, and other
files in the "ci", "projects", "scripts" and "tests" directories, have
Expand Down
30 changes: 19 additions & 11 deletions src/java.desktop/share/native/libsplashscreen/libpng/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,7 @@ Version 0.97 [January, 1998]
Added simple sRGB support (Glenn R-P)
Easier conditional compiling, e.g.,
define PNG_READ/WRITE_NOT_FULLY_SUPPORTED;
all configurable options can be selected from command-line instead
all configurable options can be selected from command line instead
of having to edit pngconf.h (Glenn R-P)
Fixed memory leak in pngwrite.c (free info_ptr->text) (Glenn R-P)
Added more conditions for png_do_background, to avoid changing
Expand Down Expand Up @@ -942,7 +942,7 @@ Version 1.0.8 [July 24, 2000]
Version 1.0.9beta1 [November 10, 2000]
Fixed typo in scripts/makefile.hpux
Updated makevms.com in scripts and contrib/* and contrib/* (Martin Zinser)
Fixed seqence-point bug in contrib/pngminus/png2pnm (Martin Zinser)
Fixed sequence-point bug in contrib/pngminus/png2pnm (Martin Zinser)
Changed "cdrom.com" in documentation to "libpng.org"
Revised pnggccrd.c to get it all working, and updated makefile.gcmmx (Greg).
Changed type of "params" from voidp to png_voidp in png_read|write_png().
Expand Down Expand Up @@ -2295,7 +2295,7 @@ Version 1.4.0beta58 [May 14, 2009]
Clarified usage of sig_bit versus sig_bit_p in example.c (Vincent Torri)

Version 1.4.0beta59 [May 15, 2009]
Reformated sources in libpng style (3-space indentation, comment format)
Reformatted sources in libpng style (3-space indentation, comment format)
Fixed typo in libpng docs (PNG_FILTER_AVE should be PNG_FILTER_AVG)
Added sections about the git repository and our coding style to the
documentation
Expand Down Expand Up @@ -2661,7 +2661,7 @@ Version 1.4.1beta06 [January 28, 2010]

Version 1.4.1beta07 [February 6, 2010]
Folded some long lines in the source files.
Added defineable PNG_USER_CHUNK_CACHE_MAX, PNG_USER_CHUNK_MALLOC_MAX,
Added definable PNG_USER_CHUNK_CACHE_MAX, PNG_USER_CHUNK_MALLOC_MAX,
and a PNG_USER_LIMITS_SUPPORTED flag.
Eliminated use of png_ptr->irowbytes and reused the slot in png_ptr as
png_ptr->png_user_chunk_malloc_max.
Expand Down Expand Up @@ -3919,7 +3919,7 @@ Version 1.6.0beta08 [February 1, 2012]
version checking to configure.ac
Improved pngstest speed by not doing redundant tests and add const to
the background parameter of png_image_finish_read. The --background
option is now done automagically only when required, so that commandline
option is now done automagically only when required, so that command-line
option no longer exists.
Cleaned up pngpriv.h to consistently declare all functions and data.
Also eliminated PNG_CONST_DATA, which is apparently not needed but we
Expand Down Expand Up @@ -4052,7 +4052,7 @@ Version 1.6.0beta16 [March 6, 2012]
(in fact this is harmless, but the PNG data produced may be sub-optimal).

Version 1.6.0beta17 [March 10, 2012]
Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition.
Fixed PNG_LIBPNG_BUILD_BASE_TYPE definition.
Reject all iCCP chunks after the first, even if the first one is invalid.
Deflate/inflate was reworked to move common zlib calls into single
functions [rw]util.c. A new shared keyword check routine was also added
Expand Down Expand Up @@ -4962,7 +4962,7 @@ Version 1.6.13beta01 [July 4, 2014]
Changed "if defined(__ARM_NEON__)" to
"if (defined(__ARM_NEON__) || defined(__ARM_NEON))" (James Wu).
Fixed clang no-warning builds: png_digit was defined but never used.

Version 1.6.13beta02 [July 21, 2014]
Fixed an incorrect separator ("/" should be "\") in scripts/makefile.vcwin32
(bug report from Wolfgang S. Kechel). Bug was introduced in libpng-1.6.11.
Expand Down Expand Up @@ -5453,7 +5453,7 @@ Version 1.6.21beta01 [December 11, 2015]
Version 1.6.21beta02 [December 14, 2015]
Moved png_check_keyword() from pngwutil.c to pngset.c
Removed LE/BE dependencies in pngvalid, to 'fix' the current problem
in the BigEndian tests by not testing it, making the BE code the same
in the BigEndian tests by not testing it, making the BE code the same
as the LE version.
Fixes to pngvalid for various reduced build configurations (eliminate unused
statics) and a fix for the case in rgb_to_gray when the digitize option
Expand Down Expand Up @@ -5517,7 +5517,7 @@ Version 1.6.22beta03 [March 9, 2016]
Added a common-law trademark notice and export control information
to the LICENSE file, png.h, and the man page.
Restored "& 0xff" in png_save_uint_16() and png_save_uint_32() that
were accidentally removed from libpng-1.6.17.
were accidentally removed from libpng-1.6.17.
Changed PNG_INFO_cHNK and PNG_FREE_cHNK from 0xnnnn to 0xnnnnU in png.h
(Robert C. Seacord).
Removed dubious "#if INT_MAX" test from png.h that was added to
Expand Down Expand Up @@ -5927,7 +5927,7 @@ Version 1.6.32beta03 [August 2, 2017]
(Bug report from the OSS-fuzz project).

Version 1.6.32beta04 [August 2, 2017]
Replaced local eXIf_buf with info_ptr-eXIf_buf in png_handle_eXIf().
Replaced local eXIf_buf with info_ptr->eXIf_buf in png_handle_eXIf().
Update libpng.3 and libpng-manual.txt about eXIf functions.

Version 1.6.32beta05 [August 2, 2017]
Expand All @@ -5950,7 +5950,7 @@ Version 1.6.32beta09 [August 3, 2017]
Require cmake-2.8.8 in CMakeLists.txt. Revised symlink creation,
no longer using deprecated cmake LOCATION feature (Clifford Yapp).
Fixed five-byte error in the calculation of IDAT maximum possible size.

Version 1.6.32beta10 [August 5, 2017]
Moved chunk-length check into a png_check_chunk_length() private
function (Suggested by Max Stepin).
Expand Down Expand Up @@ -6121,6 +6121,14 @@ Version 1.6.39 [November 20, 2022]
removed the obsolete makefile.cegcc.
Cleaned up the code and updated the internal documentation.

Version 1.6.40 [June 21, 2023]
Fixed the eXIf chunk multiplicity checks.
Fixed a memory leak in pCAL processing.
Corrected the validity report about tRNS inside png_get_valid().
Fixed various build issues on *BSD, Mac and Windows.
Updated the configurations and the scripts for continuous integration.
Cleaned up the code, the build scripts, and the documentation.

Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
Expand Down
6 changes: 3 additions & 3 deletions src/java.desktop/share/native/libsplashscreen/libpng/LICENSE
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
PNG Reference Library License version 2
---------------------------------------

* Copyright (c) 1995-2022 The PNG Reference Library Authors.
* Copyright (c) 2018-2022 Cosmin Truta.
* Copyright (c) 1995-2023 The PNG Reference Library Authors.
* Copyright (c) 2018-2023 Cosmin Truta.
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* Copyright (c) 1996-1997 Andreas Dilger.
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
Expand Down Expand Up @@ -131,4 +131,4 @@ The Contributing Authors and Group 42, Inc. specifically permit,
without fee, and encourage the use of this source code as a component
to supporting the PNG file format in commercial products. If you use
this source code in a product, acknowledgment is not required but would
be appreciated.
be appreciated.
162 changes: 80 additions & 82 deletions src/java.desktop/share/native/libsplashscreen/libpng/README
Original file line number Diff line number Diff line change
@@ -1,110 +1,108 @@
README for libpng version 1.6.39
README for libpng version 1.6.40
================================

See the note about version numbers near the top of png.h.
See INSTALL for instructions on how to install libpng.
See the note about version numbers near the top of `png.h`.
See `INSTALL` for instructions on how to install libpng.

Libpng comes in several distribution formats. Get libpng-*.tar.gz or
libpng-*.tar.xz if you want UNIX-style line endings in the text files,
or lpng*.7z or lpng*.zip if you want DOS-style line endings.
Libpng comes in several distribution formats. Get `libpng-*.tar.gz`
or `libpng-*.tar.xz` if you want UNIX-style line endings in the text
files, or `lpng*.7z` or `lpng*.zip` if you want DOS-style line endings.

Version 0.89 was the first official release of libpng. Don't let the
fact that it's the first release fool you. The libpng library has been
in extensive use and testing since mid-1995. By late 1997 it had
finally gotten to the stage where there hadn't been significant
changes to the API in some time, and people have a bad feeling about
libraries with versions < 1.0. Version 1.0.0 was released in
March 1998.
For a detailed description on using libpng, read `libpng-manual.txt`.
For examples of libpng in a program, see `example.c` and `pngtest.c`.
For usage information and restrictions (what little they are) on libpng,
see `png.h`. For a description on using zlib (the compression library
used by libpng) and zlib's restrictions, see `zlib.h`.

****
Note that some of the changes to the png_info structure render this
version of the library binary incompatible with libpng-0.89 or
earlier versions if you are using a shared library. The type of the
"filler" parameter for png_set_filler() has changed from png_byte to
png_uint_32, which will affect shared-library applications that use
this function.

To avoid problems with changes to the internals of the png info_struct,
new APIs have been made available in 0.95 to avoid direct application
access to info_ptr. These functions are the png_set_<chunk> and
png_get_<chunk> functions. These functions should be used when
accessing/storing the info_struct data, rather than manipulating it
directly, to avoid such problems in the future.

It is important to note that the APIs did not make current programs
that access the info struct directly incompatible with the new
library, through libpng-1.2.x. In libpng-1.4.x, which was meant to
be a transitional release, members of the png_struct and the
info_struct can still be accessed, but the compiler will issue a
warning about deprecated usage. Since libpng-1.5.0, direct access
to these structs is not allowed, and the definitions of the structs
reside in private pngstruct.h and pnginfo.h header files that are not
accessible to applications. It is strongly suggested that new
programs use the new APIs (as shown in example.c and pngtest.c), and
older programs be converted to the new format, to facilitate upgrades
in the future.
****

Additions since 0.90 include the ability to compile libpng as a
Windows DLL, and new APIs for accessing data in the info struct.
Experimental functions include the ability to set weighting and cost
factors for row filter selection, direct reads of integers from buffers
on big-endian processors that support misaligned data access, faster
methods of doing alpha composition, and more accurate 16->8 bit color
conversion.

The additions since 0.89 include the ability to read from a PNG stream
which has had some (or all) of the signature bytes read by the calling
application. This also allows the reading of embedded PNG streams that
do not have the PNG file signature. As well, it is now possible to set
the library action on the detection of chunk CRC errors. It is possible
to set different actions based on whether the CRC error occurred in a
critical or an ancillary chunk.

For a detailed description on using libpng, read libpng-manual.txt.
For examples of libpng in a program, see example.c and pngtest.c. For
usage information and restrictions (what little they are) on libpng,
see png.h. For a description on using zlib (the compression library
used by libpng) and zlib's restrictions, see zlib.h

I have included a general makefile, as well as several machine and
compiler specific ones, but you may have to modify one for your own
needs.

You should use zlib 1.0.4 or later to run this, but it MAY work with
You should use zlib 1.0.4 or later to run this, but it _may_ work with
versions as old as zlib 0.95. Even so, there are bugs in older zlib
versions which can cause the output of invalid compression streams for
some images.

You should also note that zlib is a compression library that is useful
for more things than just PNG files. You can use zlib as a drop-in
replacement for fread() and fwrite(), if you are so inclined.
replacement for `fread()` and `fwrite()`, if you are so inclined.

zlib should be available at the same place that libpng is, or at
https://zlib.net.
https://zlib.net .

You may also want a copy of the PNG specification. It is available
as an RFC, a W3C Recommendation, and an ISO/IEC Standard. You can find
these at http://www.libpng.org/pub/png/pngdocs.html .

This code is currently being archived at libpng.sourceforge.io in the
[DOWNLOAD] area, and at http://libpng.download/src .
This code is currently being archived at https://libpng.sourceforge.io
in the download area, and at http://libpng.download/src .

This release, based in a large way on Glenn's, Guy's and Andreas'
earlier work, was created and will be supported by myself and the PNG
development group.

Send comments/corrections/commendations to png-mng-implement at
lists.sourceforge.net (subscription required; visit
Send comments, corrections and commendations to `png-mng-implement`
at `lists.sourceforge.net`. (Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe).
to subscribe.)

Send general questions about the PNG specification to `png-mng-misc`
at `lists.sourceforge.net`. (Subscription is required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-misc
to subscribe.)

Send general questions about the PNG specification to png-mng-misc
at lists.sourceforge.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
subscribe).
Historical notes
----------------

The libpng library has been in extensive use and testing since mid-1995.
Version 0.89, published a year later, was the first official release.
By late 1997, it had finally gotten to the stage where there hadn't
been significant changes to the API in some time, and people have a bad
feeling about libraries with versions below 1.0. Version 1.0.0 was
released in March 1998.

Note that some of the changes to the `png_info` structure render this
version of the library binary incompatible with libpng-0.89 or
earlier versions if you are using a shared library. The type of the
`filler` parameter for `png_set_filler()` has changed from `png_byte`
to `png_uint_32`, which will affect shared-library applications that
use this function.

To avoid problems with changes to the internals of the `info_struct`,
new APIs have been made available in 0.95 to avoid direct application
access to `info_ptr`. These functions are the `png_set_<chunk>` and
`png_get_<chunk>` functions. These functions should be used when
accessing/storing the `info_struct` data, rather than manipulating it
directly, to avoid such problems in the future.

It is important to note that the APIs did not make current programs
that access the info struct directly incompatible with the new
library, through libpng-1.2.x. In libpng-1.4.x, which was meant to
be a transitional release, members of the `png_struct` and the
`info_struct` can still be accessed, but the compiler will issue a
warning about deprecated usage. Since libpng-1.5.0, direct access
to these structs is not allowed, and the definitions of the structs
reside in private `pngstruct.h` and `pnginfo.h` header files that are
not accessible to applications. It is strongly suggested that new
programs use the new APIs (as shown in `example.c` and `pngtest.c`),
and older programs be converted to the new format, to facilitate
upgrades in the future.

The additions since 0.89 include the ability to read from a PNG stream
which has had some (or all) of the signature bytes read by the calling
application. This also allows the reading of embedded PNG streams that
do not have the PNG file signature. As well, it is now possible to set
the library action on the detection of chunk CRC errors. It is possible
to set different actions based on whether the CRC error occurred in a
critical or an ancillary chunk.

The additions since 0.90 include the ability to compile libpng as a
Windows DLL, and new APIs for accessing data in the `info_struct`.
Experimental functions included the ability to set weighting and cost
factors for row filter selection, direct reads of integers from buffers
on big-endian processors that support misaligned data access, faster
methods of doing alpha composition, and more accurate 16-to-8 bit color
conversion. Some of these experimental functions, such as the weighted
filter heuristics, have since been removed.

Files in this distribution:
Files included in this distribution
-----------------------------------

ANNOUNCE => Announcement of this version, with recent changes
AUTHORS => List of contributing authors
Expand Down Expand Up @@ -153,7 +151,7 @@ Files in this distribution:
arm-neon/ => Optimized code for the ARM-NEON platform
mips-msa/ => Optimized code for the MIPS-MSA platform
powerpc-vsx/ => Optimized code for the POWERPC-VSX platform
examples/ => Example programs
examples/ => Examples of libpng usage
gregbook/ => Source code for PNG reading and writing, from
"PNG: The Definitive Guide" by Greg Roelofs,
O'Reilly, 1999
Expand Down
8 changes: 4 additions & 4 deletions src/java.desktop/share/native/libsplashscreen/libpng/png.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*
* Copyright (c) 2018-2022 Cosmin Truta
* Copyright (c) 2018-2023 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
Expand All @@ -42,7 +42,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_39 Your_png_h_is_not_version_1_6_39;
typedef png_libpng_version_1_6_40 Your_png_h_is_not_version_1_6_40;

#ifdef __GNUC__
/* The version tests may need to be added to, but the problem warning has
Expand Down Expand Up @@ -843,8 +843,8 @@ png_get_copyright(png_const_structrp png_ptr)
return PNG_STRING_COPYRIGHT
#else
return PNG_STRING_NEWLINE \
"libpng version 1.6.39" PNG_STRING_NEWLINE \
"Copyright (c) 2018-2022 Cosmin Truta" PNG_STRING_NEWLINE \
"libpng version 1.6.40" PNG_STRING_NEWLINE \
"Copyright (c) 2018-2023 Cosmin Truta" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
Expand Down
Loading

0 comments on commit 015dab9

Please sign in to comment.