Skip to content

Commit

Permalink
8295685: Update Libpng to 1.6.38
Browse files Browse the repository at this point in the history
Backport-of: b685fc2de4d2847de2d1efaab2890646257ea6d3
  • Loading branch information
GoeLin committed Jan 25, 2023
1 parent ba023c6 commit 62ccb39
Show file tree
Hide file tree
Showing 16 changed files with 188 additions and 132 deletions.
74 changes: 68 additions & 6 deletions src/java.desktop/share/legal/libpng.md
@@ -1,4 +1,4 @@
## libpng v1.6.37
## libpng v1.6.38

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

* Copyright (c) 1995-2019 The PNG Reference Library Authors.
* Copyright (c) 2018-2019 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.
Copyright (c) 1995-2022 The PNG Reference Library Authors.
Copyright (c) 2018-2022 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.

The software is supplied "as is", without warranty of any kind,
express or implied, including, without limitation, the warranties
Expand Down Expand Up @@ -138,4 +138,66 @@ 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.

TRADEMARK
=========

The name "libpng" has not been registered by the Copyright owners
as a trademark in any jurisdiction. However, because libpng has
been distributed and maintained world-wide, continually since 1995,
the Copyright owners claim "common-law trademark protection" in any
jurisdiction where common-law trademark is recognized.

</pre>

### AUTHORS File Information
```
PNG REFERENCE LIBRARY AUTHORS
=============================
This is the list of PNG Reference Library ("libpng") Contributing
Authors, for copyright and licensing purposes.
* Andreas Dilger
* Cosmin Truta
* Dave Martindale
* Eric S. Raymond
* Gilles Vollant
* Glenn Randers-Pehrson
* Greg Roelofs
* Guy Eric Schalnat
* James Yu
* John Bowler
* Kevin Bracey
* Magnus Holmgren
* Mandar Sahastrabuddhe
* Mans Rullgard
* Matt Sarett
* Mike Klein
* Pascal Massimino
* Paul Schmidt
* Qiang Zhou
* Sam Bushell
* Samuel Williams
* Simon-Pierre Cadieux
* Tim Wegner
* Tom Lane
* Tom Tanner
* Vadim Barkov
* Willem van Schaik
* Zhijie Liang
* Arm Holdings
- Richard Townsend
* Google Inc.
- Matt Sarett
- Mike Klein
- Dan Field
- Sami Boukortt
The build projects, the build scripts, the test scripts, and other
files in the "ci", "projects", "scripts" and "tests" directories, have
other copyright owners, but are released under the libpng license.
Some files in the "contrib" directory, and some tools-generated files
that are distributed with libpng, have other copyright owners, and are
released under other open source licenses.
```
10 changes: 8 additions & 2 deletions src/java.desktop/share/native/libsplashscreen/libpng/CHANGES
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 intentation, comment format)
Reformated 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 @@ -3886,7 +3886,7 @@ Version 1.6.0beta06 [January 24, 2012]
Version 1.6.0beta07 [January 28, 2012]
Eliminated Intel icc/icl compiler warnings. The Intel (GCC derived)
compiler issues slightly different warnings from those issued by the
current vesions of GCC. This eliminates those warnings by
current versions of GCC. This eliminates those warnings by
adding/removing casts and small code rewrites.
Updated configure.ac from autoupdate: added --enable-werror option.
Also some layout regularization and removal of introduced tab characters
Expand Down Expand Up @@ -6103,6 +6103,12 @@ Version 1.6.37 [April 14, 2019]
Added makefiles for AddressSanitizer-enabled builds.
Cleaned up various makefiles.

Version 1.6.38 [September 14, 2022]
Added configurations and scripts for continuous integration.
Fixed various errors in the handling of tRNS, hIST and eXIf.
Implemented many stability improvements across all platforms.
Updated the internal 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
4 changes: 2 additions & 2 deletions src/java.desktop/share/native/libsplashscreen/libpng/LICENSE
Expand Up @@ -4,8 +4,8 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
PNG Reference Library License version 2
---------------------------------------

* Copyright (c) 1995-2019 The PNG Reference Library Authors.
* Copyright (c) 2018-2019 Cosmin Truta.
* Copyright (c) 1995-2022 The PNG Reference Library Authors.
* Copyright (c) 2018-2022 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
8 changes: 4 additions & 4 deletions src/java.desktop/share/native/libsplashscreen/libpng/README
@@ -1,12 +1,12 @@
README for libpng version 1.6.37 - April 14, 2019
=================================================
README for libpng version 1.6.38
================================

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 or 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-*.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
Expand Down
27 changes: 17 additions & 10 deletions src/java.desktop/share/native/libsplashscreen/libpng/UPDATING.txt
Expand Up @@ -4,7 +4,7 @@ Updating libpng in OpenJDK
Usually this is just a matter of updating the version at the top,
and in the embedded text, and extending the copyright date.

The updated info comes from the LICENSE file.
The updated info comes from the LICENSE, TRADEMARK and AUTHORS files.

2) Copy LICENSE, README, and CHANGES from the new version into OpenJDK's
libpng source directory
Expand All @@ -21,9 +21,9 @@ OpenJDK has a heavily modified copy of pnglibconf.h.
This is the trickiest part of the whole exercise.
This file is generated by png at build time.
Except for the dates and version, you should generally not need to update
OpenJDK's copy unless the new version of PNG has added rquired new #defines
OpenJDK's copy unless the new version of PNG has added required new #defines
that cause problems building.
You can run configure && make on the downloaded source and compare but we
You can run configure && make on the downloaded source and compare, but we
do not want to enable any of the WRITE support, and there are many more
modifications as well.
So do NOT just copy in a file from the new libpng.
Expand All @@ -33,15 +33,22 @@ line in the GPL header.
So lots of reasons to not copy over the new version,
and instead just tweak the existing one.

5) Run scripts to expand tabs and remove trailing white space from source files.
5) Run script to expand tabs and remove trailing white space from source files.

Use expand to remove tabs
expand ${f} > ${f}.tmp
mv ${f}.tmp $f
First cd into the libpng folder and run the following script.

Use sed to remove trailing white space
sed -e 's/[ ]* $//' ${f} > ${f}.tmp
mv ${f}.tmp $f
for f in *.c *.h;
do
# replace tabs with spaces
expand ${f} > ${f}.tmp;
mv ${f}.tmp $f;

# fix line endings to LF
sed -i -e 's/\r$//g' ${f};

# remove trailing spaces
sed -i -e 's/[ ]* $//g' ${f};
done

6) As with all native code, run it through the official build systems, in case
the updated code trigger any fatal warnings with the official compilers.
Expand Down
14 changes: 7 additions & 7 deletions src/java.desktop/share/native/libsplashscreen/libpng/png.c
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-2019 Cosmin Truta
* Copyright (c) 2018-2022 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_37 Your_png_h_is_not_version_1_6_37;
typedef png_libpng_version_1_6_38 Your_png_h_is_not_version_1_6_38;

#ifdef __GNUC__
/* The version tests may need to be added to, but the problem warning has
Expand Down Expand Up @@ -748,7 +748,7 @@ png_init_io(png_structrp png_ptr, png_FILE_p fp)
*
* Where UNSIGNED_MAX is the appropriate maximum unsigned value, so when the
* negative integral value is added the result will be an unsigned value
* correspnding to the 2's complement representation.
* corresponding to the 2's complement representation.
*/
void PNGAPI
png_save_int_32(png_bytep buf, png_int_32 i)
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.37" PNG_STRING_NEWLINE \
"Copyright (c) 2018-2019 Cosmin Truta" PNG_STRING_NEWLINE \
"libpng version 1.6.38" PNG_STRING_NEWLINE \
"Copyright (c) 2018-2022 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 Expand Up @@ -1871,12 +1871,12 @@ png_icc_profile_error(png_const_structrp png_ptr, png_colorspacerp colorspace,
# ifdef PNG_WARNINGS_SUPPORTED
else
{
char number[PNG_NUMBER_BUFFER_SIZE]; /* +24 = 114*/
char number[PNG_NUMBER_BUFFER_SIZE]; /* +24 = 114 */

pos = png_safecat(message, (sizeof message), pos,
png_format_number(number, number+(sizeof number),
PNG_NUMBER_FORMAT_x, value));
pos = png_safecat(message, (sizeof message), pos, "h: "); /*+2 = 116*/
pos = png_safecat(message, (sizeof message), pos, "h: "); /* +2 = 116 */
}
# endif
/* The 'reason' is an arbitrary message, allow +79 maximum 195 */
Expand Down
26 changes: 13 additions & 13 deletions src/java.desktop/share/native/libsplashscreen/libpng/png.h
Expand Up @@ -29,9 +29,9 @@
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*
* libpng version 1.6.37 - April 14, 2019
* libpng version 1.6.38 - September 14, 2022
*
* Copyright (c) 2018-2019 Cosmin Truta
* Copyright (c) 2018-2022 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 @@ -43,7 +43,7 @@
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
* Glenn Randers-Pehrson
* libpng versions 1.6.36, December 2018, through 1.6.37, April 2019:
* libpng versions 1.6.36, December 2018, through 1.6.38, September 2022:
* Cosmin Truta
* See also "Contributing Authors", below.
*/
Expand All @@ -55,8 +55,8 @@
* PNG Reference Library License version 2
* ---------------------------------------
*
* * Copyright (c) 1995-2019 The PNG Reference Library Authors.
* * Copyright (c) 2018-2019 Cosmin Truta.
* * Copyright (c) 1995-2022 The PNG Reference Library Authors.
* * Copyright (c) 2018-2022 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 @@ -267,7 +267,7 @@
* ...
* 1.5.30 15 10530 15.so.15.30[.0]
* ...
* 1.6.37 16 10637 16.so.16.37[.0]
* 1.6.38 16 10638 16.so.16.38[.0]
*
* Henceforth the source version will match the shared-library major and
* minor numbers; the shared-library major version number will be used for
Expand Down Expand Up @@ -306,16 +306,16 @@
*/

/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.6.37"
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.37 - April 14, 2019\n"
#define PNG_LIBPNG_VER_STRING "1.6.38"
#define PNG_HEADER_VERSION_STRING " libpng version 1.6.38 - September 14, 2022\n"

#define PNG_LIBPNG_VER_SONUM 16
#define PNG_LIBPNG_VER_DLLNUM 16

/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6
#define PNG_LIBPNG_VER_RELEASE 37
#define PNG_LIBPNG_VER_RELEASE 38

/* This should be zero for a public release, or non-zero for a
* development version. [Deprecated]
Expand Down Expand Up @@ -346,7 +346,7 @@
* From version 1.0.1 it is:
* XXYYZZ, where XX=major, YY=minor, ZZ=release
*/
#define PNG_LIBPNG_VER 10637 /* 1.6.37 */
#define PNG_LIBPNG_VER 10638 /* 1.6.38 */

/* Library configuration: these options cannot be changed after
* the library has been built.
Expand Down Expand Up @@ -456,7 +456,7 @@ extern "C" {
/* This triggers a compiler error in png.c, if png.c and png.h
* do not agree upon the version number.
*/
typedef char* png_libpng_version_1_6_37;
typedef char* png_libpng_version_1_6_38;

/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
Expand Down Expand Up @@ -1474,7 +1474,7 @@ PNG_EXPORT(66, void, png_set_crc_action, (png_structrp png_ptr, int crit_action,
* mainly useful for testing, as the defaults should work with most users.
* Those users who are tight on memory or want faster performance at the
* expense of compression can modify them. See the compression library
* header file (zlib.h) for an explination of the compression functions.
* header file (zlib.h) for an explanation of the compression functions.
*/

/* Set the filtering method(s) used by libpng. Currently, the only valid
Expand Down Expand Up @@ -1529,7 +1529,7 @@ PNG_FIXED_EXPORT(209, void, png_set_filter_heuristics_fixed,
* 0 - 9, corresponding directly to the zlib compression levels 0 - 9
* (0 - no compression, 9 - "maximal" compression). Note that tests have
* shown that zlib compression levels 3-6 usually perform as well as level 9
* for PNG images, and do considerably fewer caclulations. In the future,
* for PNG images, and do considerably fewer calculations. In the future,
* these values may not correspond directly to the zlib compression levels.
*/
#ifdef PNG_WRITE_CUSTOMIZE_COMPRESSION_SUPPORTED
Expand Down
Expand Up @@ -29,9 +29,9 @@
* However, the following notice accompanied the original version of this
* file and, per its terms, should not be removed:
*
* libpng version 1.6.37
* libpng version 1.6.38
*
* Copyright (c) 2018-2019 Cosmin Truta
* Copyright (c) 2018-2022 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
Expand Down Expand Up @@ -208,8 +208,8 @@
* compiler-specific macros to the values required to change the calling
* conventions of the various functions.
*/
#if defined(_Windows) || defined(_WINDOWS) || defined(WIN32) ||\
defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
#if defined(_WIN32) || defined(__WIN32__) || defined(__NT__) || \
defined(__CYGWIN__)
/* Windows system (DOS doesn't support DLLs). Includes builds under Cygwin or
* MinGW on any architecture currently supported by Windows. Also includes
* Watcom builds but these need special treatment because they are not
Expand Down

1 comment on commit 62ccb39

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.