Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions make/modules/java.desktop/lib/ClientLibraries.gmk
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
DISABLED_WARNINGS_gcc_dgif_lib.c := sign-compare, \
DISABLED_WARNINGS_gcc_jcmaster.c := implicit-fallthrough, \
DISABLED_WARNINGS_gcc_jdphuff.c := shift-negative-value, \
DISABLED_WARNINGS_gcc_png.c := maybe-uninitialized unused-function, \
DISABLED_WARNINGS_gcc_png.c := maybe-uninitialized, \
DISABLED_WARNINGS_gcc_pngerror.c := maybe-uninitialized, \
DISABLED_WARNINGS_gcc_splashscreen_gfx_impl.c := implicit-fallthrough \
maybe-uninitialized, \
Expand All @@ -247,7 +247,6 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
DISABLED_WARNINGS_clang := deprecated-non-prototype, \
DISABLED_WARNINGS_clang_dgif_lib.c := sign-compare, \
DISABLED_WARNINGS_clang_gzwrite.c := format-nonliteral, \
DISABLED_WARNINGS_clang_png.c := unused-function, \
DISABLED_WARNINGS_clang_splashscreen_impl.c := sign-compare \
unused-but-set-variable unused-function, \
DISABLED_WARNINGS_clang_splashscreen_png.c := \
Expand Down
12 changes: 9 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.47
## libpng v1.6.51

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

Copyright (c) 1995-2025 The PNG Reference Library Authors.
Copyright (C) 1995-2025 The PNG Reference Library Authors.
Copyright (C) 2018-2025 Cosmin Truta
Copyright (C) 1998-2018 Glenn Randers-Pehrson
Copyright (C) 1996-1997 Andreas Dilger
Expand Down Expand Up @@ -173,6 +173,7 @@ Authors, for copyright and licensing purposes.
* Lucas Chollet
* Magnus Holmgren
* Mandar Sahastrabuddhe
* Manfred Schlaegl
* Mans Rullgard
* Matt Sarett
* Mike Klein
Expand All @@ -184,6 +185,7 @@ Authors, for copyright and licensing purposes.
* Samuel Williams
* Simon-Pierre Cadieux
* Tim Wegner
* Tobias Stoeckmann
* Tom Lane
* Tom Tanner
* Vadim Barkov
Expand All @@ -193,8 +195,9 @@ Authors, for copyright and licensing purposes.
- Zixu Wang (王子旭)
* Arm Holdings
- Richard Townsend
* Google Inc.
* Google LLC
- Dan Field
- Dragoș Tiselice
- Leon Scroggins III
- Matt Sarett
- Mike Klein
Expand All @@ -204,6 +207,8 @@ Authors, for copyright and licensing purposes.
- GuXiWei (顾希伟)
- JinBo (金波)
- ZhangLixia (张利霞)
* Samsung Group
- Filip Wasil

The build projects, the build scripts, the test scripts, and other
files in the "projects", "scripts" and "tests" directories, have
Expand All @@ -214,3 +219,4 @@ of the tools-generated files that are distributed with libpng, have
other copyright owners, and are released under other open source
licenses.
```

53 changes: 53 additions & 0 deletions src/java.desktop/share/native/libsplashscreen/libpng/CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -6251,6 +6251,59 @@ Version 1.6.47 [February 18, 2025]
colorspace precedence rules, due to pre-existing colorspace checks.
(Reported by Bob Friesenhahn; fixed by John Bowler)

Version 1.6.48 [April 30, 2025]
Fixed the floating-point version of the mDCv setter `png_set_mDCv`.
(Reported by Mohit Bakshi; fixed by John Bowler)
Added #error directives to discourage the inclusion of private
libpng implementation header files in PNG-supporting applications.
Added the CMake build option `PNG_LIBCONF_HEADER`, to be used as an
alternative to `DFA_XTRA`.
Removed the Travis CI configuration files, with heartfelt thanks for
their generous support of our project over the past five years!

Version 1.6.49 [June 12, 2025]
Added SIMD-optimized code for the RISC-V Vector Extension (RVV).
(Contributed by Manfred Schlaegl, Dragos Tiselice and Filip Wasil)
Added various fixes and improvements to the build scripts and to
the sample code.

Version 1.6.50 [July 1, 2025]
Improved the detection of the RVV Extension on the RISC-V platform.
(Contributed by Filip Wasil)
Replaced inline ASM with C intrinsics in the RVV code.
(Contributed by Filip Wasil)
Fixed a decoder defect in which unknown chunks trailing IDAT, set
to go through the unknown chunk handler, incorrectly triggered
out-of-place IEND errors.
(Contributed by John Bowler)
Fixed the CMake file for cross-platform builds that require `libm`.

Version 1.6.51 [November 21, 2025]
Fixed CVE-2025-64505 (moderate severity):
Heap buffer overflow in `png_do_quantize` via malformed palette index.
(Reported by Samsung; analyzed by Fabio Gritti.)
Fixed CVE-2025-64506 (moderate severity):
Heap buffer over-read in `png_write_image_8bit` with 8-bit input and
`convert_to_8bit` enabled.
(Reported by Samsung and <weijinjinnihao@users.noreply.github.com>;
analyzed by Fabio Gritti.)
Fixed CVE-2025-64720 (high severity):
Buffer overflow in `png_image_read_composite` via incorrect palette
premultiplication.
(Reported by Samsung; analyzed by John Bowler.)
Fixed CVE-2025-65018 (high severity):
Heap buffer overflow in `png_combine_row` triggered via
`png_image_finish_read`.
(Reported by <yosiimich@users.noreply.github.com>.)
Fixed a memory leak in `png_set_quantize`.
(Reported by Samsung; analyzed by Fabio Gritti.)
Removed the experimental and incomplete ERROR_NUMBERS code.
(Contributed by Tobias Stoeckmann.)
Improved the RISC-V vector extension support; required RVV 1.0 or newer.
(Contributed by Filip Wasil.)
Added GitHub Actions workflows for automated testing.
Performed various refactorings and cleanups.

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: 3 additions & 1 deletion src/java.desktop/share/native/libsplashscreen/libpng/README
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
README for libpng version 1.6.47
README for libpng version 1.6.51
================================

See the note about version numbers near the top of `png.h`.
Expand Down Expand Up @@ -147,6 +147,7 @@ Files included in this distribution
loongarch/ => Optimized code for LoongArch LSX
mips/ => Optimized code for MIPS MSA and MIPS MMI
powerpc/ => Optimized code for PowerPC VSX
riscv/ => Optimized code for the RISC-V platform
ci/ => Scripts for continuous integration
contrib/ => External contributions
arm-neon/ => Optimized code for the ARM-NEON platform
Expand All @@ -162,6 +163,7 @@ Files included in this distribution
programs demonstrating the use of pngusr.dfa
pngminus/ => Simple pnm2png and png2pnm programs
pngsuite/ => Test images
riscv-rvv/ => Optimized code for the RISC-V Vector platform
testpngs/ => Test images
tools/ => Various tools
visupng/ => VisualPng, a Windows viewer for PNG images
Expand Down
28 changes: 14 additions & 14 deletions src/java.desktop/share/native/libsplashscreen/libpng/png.c
Original file line number Diff line number Diff line change
Expand Up @@ -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_47 Your_png_h_is_not_version_1_6_47;
typedef png_libpng_version_1_6_51 Your_png_h_is_not_version_1_6_51;

/* Sanity check the chunks definitions - PNG_KNOWN_CHUNKS from pngpriv.h and the
* corresponding macro definitions. This causes a compile time failure if
Expand Down Expand Up @@ -137,10 +137,16 @@ png_zalloc,(voidpf png_ptr, uInt items, uInt size),PNG_ALLOCATED)
if (png_ptr == NULL)
return NULL;

if (items >= (~(png_alloc_size_t)0)/size)
/* This check against overflow is vestigial, dating back from
* the old times when png_zalloc used to be an exported function.
* We're still keeping it here for now, as an extra-cautious
* prevention against programming errors inside zlib, although it
* should rather be a debug-time assertion instead.
*/
if (size != 0 && items >= (~(png_alloc_size_t)0) / size)
{
png_warning (png_voidcast(png_structrp, png_ptr),
"Potential overflow in png_zalloc()");
png_warning(png_voidcast(png_structrp, png_ptr),
"Potential overflow in png_zalloc()");
return NULL;
}

Expand Down Expand Up @@ -267,10 +273,6 @@ png_user_version_check(png_structrp png_ptr, png_const_charp user_png_ver)
png_warning(png_ptr, m);
#endif

#ifdef PNG_ERROR_NUMBERS_SUPPORTED
png_ptr->flags = 0;
#endif

return 0;
}

Expand Down Expand Up @@ -729,7 +731,7 @@ png_get_io_ptr(png_const_structrp png_ptr)
* function of your own because "FILE *" isn't necessarily available.
*/
void PNGAPI
png_init_io(png_structrp png_ptr, png_FILE_p fp)
png_init_io(png_structrp png_ptr, FILE *fp)
{
png_debug(1, "in png_init_io");

Expand Down Expand Up @@ -844,7 +846,7 @@ png_get_copyright(png_const_structrp png_ptr)
return PNG_STRING_COPYRIGHT
#else
return PNG_STRING_NEWLINE \
"libpng version 1.6.47" PNG_STRING_NEWLINE \
"libpng version 1.6.51" PNG_STRING_NEWLINE \
"Copyright (c) 2018-2025 Cosmin Truta" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \
Expand Down Expand Up @@ -1520,7 +1522,7 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
}
#endif /* COLORSPACE */

#ifdef PNG_iCCP_SUPPORTED
#ifdef PNG_READ_iCCP_SUPPORTED
/* Error message generation */
static char
png_icc_tag_char(png_uint_32 byte)
Expand Down Expand Up @@ -1596,9 +1598,7 @@ png_icc_profile_error(png_const_structrp png_ptr, png_const_charp name,

return 0;
}
#endif /* iCCP */

#ifdef PNG_READ_iCCP_SUPPORTED
/* Encoded value of D50 as an ICC XYZNumber. From the ICC 2010 spec the value
* is XYZ(0.9642,1.0,0.8249), which scales to:
*
Expand Down Expand Up @@ -3998,7 +3998,7 @@ png_image_free_function(png_voidp argument)
# ifdef PNG_STDIO_SUPPORTED
if (cp->owned_file != 0)
{
FILE *fp = png_voidcast(FILE*, cp->png_ptr->io_ptr);
FILE *fp = png_voidcast(FILE *, cp->png_ptr->io_ptr);
cp->owned_file = 0;

/* Ignore errors here. */
Expand Down
57 changes: 38 additions & 19 deletions src/java.desktop/share/native/libsplashscreen/libpng/png.h
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:
*
* libpng version 1.6.47
* libpng version 1.6.51
*
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
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.47, February 2025:
* libpng versions 1.6.36, December 2018, through 1.6.51, November 2025:
* Cosmin Truta
* See also "Contributing Authors", below.
*/
Expand Down Expand Up @@ -267,7 +267,7 @@
* ...
* 1.5.30 15 10530 15.so.15.30[.0]
* ...
* 1.6.47 16 10647 16.so.16.47[.0]
* 1.6.51 16 10651 16.so.16.51[.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 @@ -303,7 +303,7 @@
*/

/* Version information for png.h - this should match the version in png.c */
#define PNG_LIBPNG_VER_STRING "1.6.47"
#define PNG_LIBPNG_VER_STRING "1.6.51"
#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"

/* The versions of shared library builds should stay in sync, going forward */
Expand All @@ -314,7 +314,7 @@
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
#define PNG_LIBPNG_VER_MAJOR 1
#define PNG_LIBPNG_VER_MINOR 6
#define PNG_LIBPNG_VER_RELEASE 47
#define PNG_LIBPNG_VER_RELEASE 51

/* This should be zero for a public release, or non-zero for a
* development version.
Expand Down Expand Up @@ -345,7 +345,7 @@
* From version 1.0.1 it is:
* XXYYZZ, where XX=major, YY=minor, ZZ=release
*/
#define PNG_LIBPNG_VER 10647 /* 1.6.47 */
#define PNG_LIBPNG_VER 10651 /* 1.6.51 */

/* Library configuration: these options cannot be changed after
* the library has been built.
Expand Down Expand Up @@ -455,7 +455,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_47;
typedef char* png_libpng_version_1_6_51;

/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
Expand Down Expand Up @@ -1599,7 +1599,7 @@ PNG_EXPORT(226, void, png_set_text_compression_method, (png_structrp png_ptr,

#ifdef PNG_STDIO_SUPPORTED
/* Initialize the input/output for the PNG file to the default functions. */
PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, png_FILE_p fp));
PNG_EXPORT(74, void, png_init_io, (png_structrp png_ptr, FILE *fp));
#endif

/* Replace the (error and abort), and warning functions with user
Expand Down Expand Up @@ -3117,7 +3117,7 @@ PNG_EXPORT(234, int, png_image_begin_read_from_file, (png_imagep image,
*/

PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image,
FILE* file));
FILE *file));
/* The PNG header is read from the stdio FILE object. */
#endif /* STDIO */

Expand Down Expand Up @@ -3192,7 +3192,7 @@ PNG_EXPORT(239, int, png_image_write_to_file, (png_imagep image,
PNG_EXPORT(240, int, png_image_write_to_stdio, (png_imagep image, FILE *file,
int convert_to_8_bit, const void *buffer, png_int_32 row_stride,
const void *colormap));
/* Write the image to the given (FILE*). */
/* Write the image to the given FILE object. */
#endif /* SIMPLIFIED_WRITE_STDIO */

/* With all write APIs if image is in one of the linear formats with 16-bit
Expand Down Expand Up @@ -3332,26 +3332,45 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
* selected at run time.
*/
#ifdef PNG_SET_OPTION_SUPPORTED

/* HARDWARE: ARM Neon SIMD instructions supported */
#ifdef PNG_ARM_NEON_API_SUPPORTED
# define PNG_ARM_NEON 0 /* HARDWARE: ARM Neon SIMD instructions supported */
# define PNG_ARM_NEON 0
#endif
#define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */
#define PNG_SKIP_sRGB_CHECK_PROFILE 4 /* SOFTWARE: Check ICC profile for sRGB */

/* SOFTWARE: Force maximum window */
#define PNG_MAXIMUM_INFLATE_WINDOW 2

/* SOFTWARE: Check ICC profile for sRGB */
#define PNG_SKIP_sRGB_CHECK_PROFILE 4

/* HARDWARE: MIPS MSA SIMD instructions supported */
#ifdef PNG_MIPS_MSA_API_SUPPORTED
# define PNG_MIPS_MSA 6 /* HARDWARE: MIPS Msa SIMD instructions supported */
# define PNG_MIPS_MSA 6
#endif

/* SOFTWARE: Disable Adler32 check on IDAT */
#ifdef PNG_DISABLE_ADLER32_CHECK_SUPPORTED
# define PNG_IGNORE_ADLER32 8 /* SOFTWARE: disable Adler32 check on IDAT */
# define PNG_IGNORE_ADLER32 8
#endif

/* HARDWARE: PowerPC VSX SIMD instructions supported */
#ifdef PNG_POWERPC_VSX_API_SUPPORTED
# define PNG_POWERPC_VSX 10 /* HARDWARE: PowerPC VSX SIMD instructions
* supported */
# define PNG_POWERPC_VSX 10
#endif

/* HARDWARE: MIPS MMI SIMD instructions supported */
#ifdef PNG_MIPS_MMI_API_SUPPORTED
# define PNG_MIPS_MMI 12 /* HARDWARE: MIPS MMI SIMD instructions supported */
# define PNG_MIPS_MMI 12
#endif

/* HARDWARE: RISC-V RVV SIMD instructions supported */
#ifdef PNG_RISCV_RVV_API_SUPPORTED
# define PNG_RISCV_RVV 14
#endif

#define PNG_OPTION_NEXT 14 /* Next option - numbers must be even */
/* Next option - numbers must be even */
#define PNG_OPTION_NEXT 16

/* Return values: NOTE: there are four values and 'off' is *not* zero */
#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */
Expand Down
Loading