Skip to content

Commit 86a5a83

Browse files
committed
8372534: Update Libpng to 1.6.51
Reviewed-by: mbaesken Backport-of: 5c2ab8e
1 parent b03c019 commit 86a5a83

File tree

20 files changed

+430
-339
lines changed

20 files changed

+430
-339
lines changed

src/java.desktop/share/legal/libpng.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## libpng v1.6.47
1+
## libpng v1.6.51
22

33
### libpng License
44
<pre>
@@ -9,7 +9,7 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE
99
PNG Reference Library License version 2
1010
---------------------------------------
1111

12-
Copyright (c) 1995-2025 The PNG Reference Library Authors.
12+
Copyright (C) 1995-2025 The PNG Reference Library Authors.
1313
Copyright (C) 2018-2025 Cosmin Truta
1414
Copyright (C) 1998-2018 Glenn Randers-Pehrson
1515
Copyright (C) 1996-1997 Andreas Dilger
@@ -173,6 +173,7 @@ Authors, for copyright and licensing purposes.
173173
* Lucas Chollet
174174
* Magnus Holmgren
175175
* Mandar Sahastrabuddhe
176+
* Manfred Schlaegl
176177
* Mans Rullgard
177178
* Matt Sarett
178179
* Mike Klein
@@ -184,6 +185,7 @@ Authors, for copyright and licensing purposes.
184185
* Samuel Williams
185186
* Simon-Pierre Cadieux
186187
* Tim Wegner
188+
* Tobias Stoeckmann
187189
* Tom Lane
188190
* Tom Tanner
189191
* Vadim Barkov
@@ -193,8 +195,9 @@ Authors, for copyright and licensing purposes.
193195
- Zixu Wang (王子旭)
194196
* Arm Holdings
195197
- Richard Townsend
196-
* Google Inc.
198+
* Google LLC
197199
- Dan Field
200+
- Dragoș Tiselice
198201
- Leon Scroggins III
199202
- Matt Sarett
200203
- Mike Klein
@@ -204,6 +207,8 @@ Authors, for copyright and licensing purposes.
204207
- GuXiWei (顾希伟)
205208
- JinBo (金波)
206209
- ZhangLixia (张利霞)
210+
* Samsung Group
211+
- Filip Wasil
207212
208213
The build projects, the build scripts, the test scripts, and other
209214
files in the "projects", "scripts" and "tests" directories, have
@@ -214,3 +219,4 @@ of the tools-generated files that are distributed with libpng, have
214219
other copyright owners, and are released under other open source
215220
licenses.
216221
```
222+

src/java.desktop/share/native/libsplashscreen/libpng/CHANGES

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6251,6 +6251,59 @@ Version 1.6.47 [February 18, 2025]
62516251
colorspace precedence rules, due to pre-existing colorspace checks.
62526252
(Reported by Bob Friesenhahn; fixed by John Bowler)
62536253

6254+
Version 1.6.48 [April 30, 2025]
6255+
Fixed the floating-point version of the mDCv setter `png_set_mDCv`.
6256+
(Reported by Mohit Bakshi; fixed by John Bowler)
6257+
Added #error directives to discourage the inclusion of private
6258+
libpng implementation header files in PNG-supporting applications.
6259+
Added the CMake build option `PNG_LIBCONF_HEADER`, to be used as an
6260+
alternative to `DFA_XTRA`.
6261+
Removed the Travis CI configuration files, with heartfelt thanks for
6262+
their generous support of our project over the past five years!
6263+
6264+
Version 1.6.49 [June 12, 2025]
6265+
Added SIMD-optimized code for the RISC-V Vector Extension (RVV).
6266+
(Contributed by Manfred Schlaegl, Dragos Tiselice and Filip Wasil)
6267+
Added various fixes and improvements to the build scripts and to
6268+
the sample code.
6269+
6270+
Version 1.6.50 [July 1, 2025]
6271+
Improved the detection of the RVV Extension on the RISC-V platform.
6272+
(Contributed by Filip Wasil)
6273+
Replaced inline ASM with C intrinsics in the RVV code.
6274+
(Contributed by Filip Wasil)
6275+
Fixed a decoder defect in which unknown chunks trailing IDAT, set
6276+
to go through the unknown chunk handler, incorrectly triggered
6277+
out-of-place IEND errors.
6278+
(Contributed by John Bowler)
6279+
Fixed the CMake file for cross-platform builds that require `libm`.
6280+
6281+
Version 1.6.51 [November 21, 2025]
6282+
Fixed CVE-2025-64505 (moderate severity):
6283+
Heap buffer overflow in `png_do_quantize` via malformed palette index.
6284+
(Reported by Samsung; analyzed by Fabio Gritti.)
6285+
Fixed CVE-2025-64506 (moderate severity):
6286+
Heap buffer over-read in `png_write_image_8bit` with 8-bit input and
6287+
`convert_to_8bit` enabled.
6288+
(Reported by Samsung and <[email protected]>;
6289+
analyzed by Fabio Gritti.)
6290+
Fixed CVE-2025-64720 (high severity):
6291+
Buffer overflow in `png_image_read_composite` via incorrect palette
6292+
premultiplication.
6293+
(Reported by Samsung; analyzed by John Bowler.)
6294+
Fixed CVE-2025-65018 (high severity):
6295+
Heap buffer overflow in `png_combine_row` triggered via
6296+
`png_image_finish_read`.
6297+
(Reported by <[email protected]>.)
6298+
Fixed a memory leak in `png_set_quantize`.
6299+
(Reported by Samsung; analyzed by Fabio Gritti.)
6300+
Removed the experimental and incomplete ERROR_NUMBERS code.
6301+
(Contributed by Tobias Stoeckmann.)
6302+
Improved the RISC-V vector extension support; required RVV 1.0 or newer.
6303+
(Contributed by Filip Wasil.)
6304+
Added GitHub Actions workflows for automated testing.
6305+
Performed various refactorings and cleanups.
6306+
62546307
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
62556308
Subscription is required; visit
62566309
https://lists.sourceforge.net/lists/listinfo/png-mng-implement

src/java.desktop/share/native/libsplashscreen/libpng/README

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
README for libpng version 1.6.47
1+
README for libpng version 1.6.51
22
================================
33

44
See the note about version numbers near the top of `png.h`.
@@ -147,6 +147,7 @@ Files included in this distribution
147147
loongarch/ => Optimized code for LoongArch LSX
148148
mips/ => Optimized code for MIPS MSA and MIPS MMI
149149
powerpc/ => Optimized code for PowerPC VSX
150+
riscv/ => Optimized code for the RISC-V platform
150151
ci/ => Scripts for continuous integration
151152
contrib/ => External contributions
152153
arm-neon/ => Optimized code for the ARM-NEON platform
@@ -162,6 +163,7 @@ Files included in this distribution
162163
programs demonstrating the use of pngusr.dfa
163164
pngminus/ => Simple pnm2png and png2pnm programs
164165
pngsuite/ => Test images
166+
riscv-rvv/ => Optimized code for the RISC-V Vector platform
165167
testpngs/ => Test images
166168
tools/ => Various tools
167169
visupng/ => VisualPng, a Windows viewer for PNG images

src/java.desktop/share/native/libsplashscreen/libpng/png.c

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
#include "pngpriv.h"
4343

4444
/* Generate a compiler error if there is an old png.h in the search path. */
45-
typedef png_libpng_version_1_6_47 Your_png_h_is_not_version_1_6_47;
45+
typedef png_libpng_version_1_6_51 Your_png_h_is_not_version_1_6_51;
4646

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

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

@@ -267,10 +273,6 @@ png_user_version_check(png_structrp png_ptr, png_const_charp user_png_ver)
267273
png_warning(png_ptr, m);
268274
#endif
269275

270-
#ifdef PNG_ERROR_NUMBERS_SUPPORTED
271-
png_ptr->flags = 0;
272-
#endif
273-
274276
return 0;
275277
}
276278

@@ -729,7 +731,7 @@ png_get_io_ptr(png_const_structrp png_ptr)
729731
* function of your own because "FILE *" isn't necessarily available.
730732
*/
731733
void PNGAPI
732-
png_init_io(png_structrp png_ptr, png_FILE_p fp)
734+
png_init_io(png_structrp png_ptr, FILE *fp)
733735
{
734736
png_debug(1, "in png_init_io");
735737

@@ -844,7 +846,7 @@ png_get_copyright(png_const_structrp png_ptr)
844846
return PNG_STRING_COPYRIGHT
845847
#else
846848
return PNG_STRING_NEWLINE \
847-
"libpng version 1.6.47" PNG_STRING_NEWLINE \
849+
"libpng version 1.6.51" PNG_STRING_NEWLINE \
848850
"Copyright (c) 2018-2025 Cosmin Truta" PNG_STRING_NEWLINE \
849851
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
850852
PNG_STRING_NEWLINE \
@@ -1520,7 +1522,7 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
15201522
}
15211523
#endif /* COLORSPACE */
15221524

1523-
#ifdef PNG_iCCP_SUPPORTED
1525+
#ifdef PNG_READ_iCCP_SUPPORTED
15241526
/* Error message generation */
15251527
static char
15261528
png_icc_tag_char(png_uint_32 byte)
@@ -1596,9 +1598,7 @@ png_icc_profile_error(png_const_structrp png_ptr, png_const_charp name,
15961598

15971599
return 0;
15981600
}
1599-
#endif /* iCCP */
16001601

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

40044004
/* Ignore errors here. */

src/java.desktop/share/native/libsplashscreen/libpng/png.h

Lines changed: 38 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
* However, the following notice accompanied the original version of this
3030
* file and, per its terms, should not be removed:
3131
*
32-
* libpng version 1.6.47
32+
* libpng version 1.6.51
3333
*
3434
* Copyright (c) 2018-2025 Cosmin Truta
3535
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
@@ -43,7 +43,7 @@
4343
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
4444
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
4545
* Glenn Randers-Pehrson
46-
* libpng versions 1.6.36, December 2018, through 1.6.47, February 2025:
46+
* libpng versions 1.6.36, December 2018, through 1.6.51, November 2025:
4747
* Cosmin Truta
4848
* See also "Contributing Authors", below.
4949
*/
@@ -267,7 +267,7 @@
267267
* ...
268268
* 1.5.30 15 10530 15.so.15.30[.0]
269269
* ...
270-
* 1.6.47 16 10647 16.so.16.47[.0]
270+
* 1.6.51 16 10651 16.so.16.51[.0]
271271
*
272272
* Henceforth the source version will match the shared-library major and
273273
* minor numbers; the shared-library major version number will be used for
@@ -303,7 +303,7 @@
303303
*/
304304

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

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

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

350350
/* Library configuration: these options cannot be changed after
351351
* the library has been built.
@@ -455,7 +455,7 @@ extern "C" {
455455
/* This triggers a compiler error in png.c, if png.c and png.h
456456
* do not agree upon the version number.
457457
*/
458-
typedef char* png_libpng_version_1_6_47;
458+
typedef char* png_libpng_version_1_6_51;
459459

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

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

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

31193119
PNG_EXPORT(235, int, png_image_begin_read_from_stdio, (png_imagep image,
3120-
FILE* file));
3120+
FILE *file));
31213121
/* The PNG header is read from the stdio FILE object. */
31223122
#endif /* STDIO */
31233123

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

31983198
/* With all write APIs if image is in one of the linear formats with 16-bit
@@ -3332,26 +3332,45 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
33323332
* selected at run time.
33333333
*/
33343334
#ifdef PNG_SET_OPTION_SUPPORTED
3335+
3336+
/* HARDWARE: ARM Neon SIMD instructions supported */
33353337
#ifdef PNG_ARM_NEON_API_SUPPORTED
3336-
# define PNG_ARM_NEON 0 /* HARDWARE: ARM Neon SIMD instructions supported */
3338+
# define PNG_ARM_NEON 0
33373339
#endif
3338-
#define PNG_MAXIMUM_INFLATE_WINDOW 2 /* SOFTWARE: force maximum window */
3339-
#define PNG_SKIP_sRGB_CHECK_PROFILE 4 /* SOFTWARE: Check ICC profile for sRGB */
3340+
3341+
/* SOFTWARE: Force maximum window */
3342+
#define PNG_MAXIMUM_INFLATE_WINDOW 2
3343+
3344+
/* SOFTWARE: Check ICC profile for sRGB */
3345+
#define PNG_SKIP_sRGB_CHECK_PROFILE 4
3346+
3347+
/* HARDWARE: MIPS MSA SIMD instructions supported */
33403348
#ifdef PNG_MIPS_MSA_API_SUPPORTED
3341-
# define PNG_MIPS_MSA 6 /* HARDWARE: MIPS Msa SIMD instructions supported */
3349+
# define PNG_MIPS_MSA 6
33423350
#endif
3351+
3352+
/* SOFTWARE: Disable Adler32 check on IDAT */
33433353
#ifdef PNG_DISABLE_ADLER32_CHECK_SUPPORTED
3344-
# define PNG_IGNORE_ADLER32 8 /* SOFTWARE: disable Adler32 check on IDAT */
3354+
# define PNG_IGNORE_ADLER32 8
33453355
#endif
3356+
3357+
/* HARDWARE: PowerPC VSX SIMD instructions supported */
33463358
#ifdef PNG_POWERPC_VSX_API_SUPPORTED
3347-
# define PNG_POWERPC_VSX 10 /* HARDWARE: PowerPC VSX SIMD instructions
3348-
* supported */
3359+
# define PNG_POWERPC_VSX 10
33493360
#endif
3361+
3362+
/* HARDWARE: MIPS MMI SIMD instructions supported */
33503363
#ifdef PNG_MIPS_MMI_API_SUPPORTED
3351-
# define PNG_MIPS_MMI 12 /* HARDWARE: MIPS MMI SIMD instructions supported */
3364+
# define PNG_MIPS_MMI 12
3365+
#endif
3366+
3367+
/* HARDWARE: RISC-V RVV SIMD instructions supported */
3368+
#ifdef PNG_RISCV_RVV_API_SUPPORTED
3369+
# define PNG_RISCV_RVV 14
33523370
#endif
33533371

3354-
#define PNG_OPTION_NEXT 14 /* Next option - numbers must be even */
3372+
/* Next option - numbers must be even */
3373+
#define PNG_OPTION_NEXT 16
33553374

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

0 commit comments

Comments
 (0)