Skip to content

Commit fe57c1c

Browse files
committed
8380959: Update Libpng to 1.6.56
Reviewed-by: andrew Backport-of: 77cfead
1 parent 2fe611a commit fe57c1c

File tree

15 files changed

+218
-122
lines changed

15 files changed

+218
-122
lines changed

make/modules/java.desktop/lib/ClientLibraries.gmk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#
2-
# Copyright (c) 2011, 2025, Oracle and/or its affiliates. All rights reserved.
2+
# Copyright (c) 2011, 2026, Oracle and/or its affiliates. All rights reserved.
33
# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
#
55
# This code is free software; you can redistribute it and/or modify it
@@ -256,6 +256,7 @@ ifeq ($(ENABLE_HEADLESS_ONLY), false)
256256
DISABLED_WARNINGS_microsoft_dgif_lib.c := 4018 4267, \
257257
DISABLED_WARNINGS_microsoft_splashscreen_impl.c := 4018 4267 4244, \
258258
DISABLED_WARNINGS_microsoft_splashscreen_png.c := 4267, \
259+
DISABLED_WARNINGS_microsoft_pngread.c := 4146, \
259260
DISABLED_WARNINGS_microsoft_splashscreen_sys.c := 4267 4244, \
260261
LDFLAGS := $(ICONV_LDFLAGS), \
261262
LDFLAGS_windows := -delayload:user32.dll, \

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
## libpng v1.6.55
1+
## libpng v1.6.56
22

33
### libpng License
44
<pre>
@@ -168,6 +168,7 @@ Authors, for copyright and licensing purposes.
168168
* Glenn Randers-Pehrson
169169
* Greg Roelofs
170170
* Guy Eric Schalnat
171+
* Halil Oktay
171172
* James Yu
172173
* John Bowler
173174
* Joshua Inscoe
@@ -187,12 +188,14 @@ Authors, for copyright and licensing purposes.
187188
* Sam Bushell
188189
* Samuel Williams
189190
* Simon-Pierre Cadieux
191+
* Taegu Ha (하태구)
190192
* Tim Wegner
191193
* Tobias Stoeckmann
192194
* Tom Lane
193195
* Tom Tanner
194196
* Vadim Barkov
195197
* Willem van Schaik
198+
* Yuelin Wang (王跃林)
196199
* Zhijie Liang
197200
* Apple Inc.
198201
- Zixu Wang (王子旭)

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

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6337,6 +6337,37 @@ Version 1.6.55 [February 9, 2026]
63376337
Resolved an oss-fuzz build issue involving nalloc.
63386338
(Contributed by Philippe Antoine.)
63396339

6340+
Version 1.6.56 [March 25, 2026]
6341+
Fixed CVE-2026-33416 (high severity):
6342+
Use-after-free via pointer aliasing in `png_set_tRNS` and `png_set_PLTE`.
6343+
(Reported by Halil Oktay and Ryo Shimada;
6344+
fixed by Halil Oktay and Cosmin Truta.)
6345+
Fixed CVE-2026-33636 (high severity):
6346+
Out-of-bounds read/write in the palette expansion on ARM Neon.
6347+
(Reported by Taegu Ha; fixed by Taegu Ha and Cosmin Truta.)
6348+
Fixed uninitialized reads beyond `num_trans` in `trans_alpha` buffers.
6349+
(Contributed by Halil Oktay.)
6350+
Fixed stale `info_ptr->palette` after in-place gamma and background
6351+
transforms.
6352+
Fixed wrong channel indices in `png_image_read_and_map` RGB_ALPHA path.
6353+
(Contributed by Yuelin Wang.)
6354+
Fixed wrong background color in colormap read.
6355+
(Contributed by Yuelin Wang.)
6356+
Fixed dead loop in sPLT write.
6357+
(Contributed by Yuelin Wang.)
6358+
Added missing null pointer checks in four public API functions.
6359+
(Contributed by Yuelin Wang.)
6360+
Validated shift bit depths in `png_set_shift` to prevent infinite loop.
6361+
(Contributed by Yuelin Wang.)
6362+
Avoided undefined behavior in library and tests.
6363+
Deprecated the hardly-ever-tested POINTER_INDEXING config option.
6364+
Added negative-stride test coverage for the simplified API.
6365+
Fixed memory leaks and API misuse in oss-fuzz.
6366+
(Contributed by Owen Sanzas.)
6367+
Implemented various fixes and improvements in oss-fuzz.
6368+
(Contributed by Bob Friesenhahn and Philippe Antoine.)
6369+
Performed various refactorings and cleanups.
6370+
63406371
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
63416372
Subscription is required; visit
63426373
<https://lists.sourceforge.net/lists/listinfo/png-mng-implement>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
README for libpng version 1.6.55
1+
README for libpng version 1.6.56
22
================================
33

44
See the note about version numbers near the top of `png.h`.

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

Lines changed: 8 additions & 8 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_55 Your_png_h_is_not_version_1_6_55;
45+
typedef png_libpng_version_1_6_56 Your_png_h_is_not_version_1_6_56;
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
@@ -849,7 +849,7 @@ png_get_copyright(png_const_structrp png_ptr)
849849
return PNG_STRING_COPYRIGHT
850850
#else
851851
return PNG_STRING_NEWLINE \
852-
"libpng version 1.6.55" PNG_STRING_NEWLINE \
852+
"libpng version 1.6.56" PNG_STRING_NEWLINE \
853853
"Copyright (c) 2018-2026 Cosmin Truta" PNG_STRING_NEWLINE \
854854
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
855855
PNG_STRING_NEWLINE \
@@ -1199,7 +1199,7 @@ png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ)
11991199
return 1;
12001200

12011201
/* The reference white is simply the sum of the end-point (X,Y,Z) vectors so
1202-
* the fillowing calculates (X+Y+Z) of the reference white (media white,
1202+
* the following calculates (X+Y+Z) of the reference white (media white,
12031203
* encoding white) itself:
12041204
*/
12051205
d = dblue;
@@ -1244,9 +1244,9 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
12441244
* (-0.0770) because the PNG spec itself requires the xy values to be
12451245
* unsigned. whitey is also required to be 5 or more to avoid overflow.
12461246
*
1247-
* Instead the upper limits have been relaxed to accomodate ACES AP1 where
1247+
* Instead the upper limits have been relaxed to accommodate ACES AP1 where
12481248
* redz ends up as -600 (-0.006). ProPhotoRGB was already "in range."
1249-
* The new limit accomodates the AP0 and AP1 ranges for z but not AP0 redy.
1249+
* The new limit accommodates the AP0 and AP1 ranges for z but not AP0 redy.
12501250
*/
12511251
const png_fixed_point fpLimit = PNG_FP_1+(PNG_FP_1/10);
12521252
if (xy->redx < 0 || xy->redx > fpLimit) return 1;
@@ -1357,7 +1357,7 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
13571357
* red-scale + green-scale + blue-scale = 1/white-y = white-scale
13581358
*
13591359
* So now we have a Cramer's rule solution where the determinants are just
1360-
* 3x3 - far more tractible. Unfortunately 3x3 determinants still involve
1360+
* 3x3 - far more tractable. Unfortunately 3x3 determinants still involve
13611361
* multiplication of three coefficients so we can't guarantee to avoid
13621362
* overflow in the libpng fixed point representation. Using Cramer's rule in
13631363
* floating point is probably a good choice here, but it's not an option for
@@ -1726,7 +1726,7 @@ png_icc_check_header(png_const_structrp png_ptr, png_const_charp name,
17261726
* into R, G and B channels.
17271727
*
17281728
* Previously it was suggested that an RGB profile on grayscale data could be
1729-
* handled. However it it is clear that using an RGB profile in this context
1729+
* handled. However it is clear that using an RGB profile in this context
17301730
* must be an error - there is no specification of what it means. Thus it is
17311731
* almost certainly more correct to ignore the profile.
17321732
*/
@@ -2944,7 +2944,7 @@ png_gamma_significant(png_fixed_point gamma_val)
29442944
*
29452945
* 2.2/(2+51/256) == 1.00035524
29462946
*
2947-
* I.e. vanishly small (<4E-4) but still detectable in 16-bit linear (+/-
2947+
* I.e. vanishingly small (<4E-4) but still detectable in 16-bit linear (+/-
29482948
* 23). Note that the Adobe choice seems to be something intended to give an
29492949
* exact number with 8 binary fractional digits - it is the closest to 2.2
29502950
* that is possible a base 2 .8p representation.

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

Lines changed: 8 additions & 8 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.55
32+
* libpng version 1.6.56
3333
*
3434
* Copyright (c) 2018-2026 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.55, February 2026:
46+
* libpng versions 1.6.36, December 2018, through 1.6.56, March 2026:
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.55 16 10655 16.so.16.55[.0]
270+
* 1.6.56 16 10656 16.so.16.56[.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.55"
306+
#define PNG_LIBPNG_VER_STRING "1.6.56"
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 55
317+
#define PNG_LIBPNG_VER_RELEASE 56
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 10655 /* 1.6.55 */
348+
#define PNG_LIBPNG_VER 10656 /* 1.6.56 */
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_55;
458+
typedef char *png_libpng_version_1_6_56;
459459

460460
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
461461
*
@@ -2370,7 +2370,7 @@ PNG_EXPORT(162, int, png_get_text,
23702370
#endif
23712371

23722372
/* Note while png_set_text() will accept a structure whose text,
2373-
* language, and translated keywords are NULL pointers, the structure
2373+
* language, and translated keywords are NULL pointers, the structure
23742374
* returned by png_get_text will always contain regular
23752375
* zero-terminated C strings. They might be empty strings but
23762376
* they will never be NULL pointers.

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

Lines changed: 1 addition & 1 deletion
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.55
32+
* libpng version 1.6.56
3333
*
3434
* Copyright (c) 2018-2026 Cosmin Truta
3535
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
* However, the following notice accompanied the original version of this
3232
* file and, per its terms, should not be removed:
3333
*/
34-
/* libpng version 1.6.55 */
34+
/* libpng version 1.6.56 */
3535

3636
/* Copyright (c) 2018-2026 Cosmin Truta */
3737
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -986,7 +986,7 @@
986986
*
987987
* At present these index values are not exported (not part of the public API)
988988
* so can be changed at will. For convenience the names are in lexical sort
989-
* order but with the critical chunks at the start in the order of occurence in
989+
* order but with the critical chunks at the start in the order of occurrence in
990990
* a PNG.
991991
*
992992
* PNG_INFO_ values do not exist for every one of these chunk handles; for
@@ -2115,7 +2115,7 @@ PNG_INTERNAL_FUNCTION(void, png_ascii_from_fixed,
21152115
* not valid it will be the index of a character in the supposed number.
21162116
*
21172117
* The format of a number is defined in the PNG extensions specification
2118-
* and this API is strictly conformant to that spec, not anyone elses!
2118+
* and this API is strictly conformant to that spec, not anyone else's!
21192119
*
21202120
* The format as a regular expression is:
21212121
*

0 commit comments

Comments
 (0)