Skip to content

Commit e8bc831

Browse files
committed
Update libpng to version 1.6.43.
1 parent 0f45e67 commit e8bc831

File tree

8 files changed

+59
-55
lines changed

8 files changed

+59
-55
lines changed

ChangeLog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ dd.mm.yy hh:mm - smooth alpha 0.9.11
88
- upgraded libcpuid to version 0.6.4
99
- upgraded libxml2 to version 2.12.5
1010
- upgraded libcurl to version 8.6.0
11-
- upgraded libpng to version 1.6.42
11+
- upgraded libpng to version 1.6.43
1212
- upgraded libwebp to version 1.3.2
1313
- upgraded zlib to version 1.3.1
1414
- upgraded libjpeg to version 9f

include/support/libpng/png.h

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/* png.h - header file for PNG reference library
33
*
4-
* libpng version 1.6.42
4+
* libpng version 1.6.43
55
*
66
* Copyright (c) 2018-2024 Cosmin Truta
77
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
@@ -15,7 +15,7 @@
1515
* libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger
1616
* libpng versions 0.97, January 1998, through 1.6.35, July 2018:
1717
* Glenn Randers-Pehrson
18-
* libpng versions 1.6.36, December 2018, through 1.6.42, January 2024:
18+
* libpng versions 1.6.36, December 2018, through 1.6.43, February 2024:
1919
* Cosmin Truta
2020
* See also "Contributing Authors", below.
2121
*/
@@ -239,7 +239,7 @@
239239
* ...
240240
* 1.5.30 15 10530 15.so.15.30[.0]
241241
* ...
242-
* 1.6.42 16 10641 16.so.16.41[.0]
242+
* 1.6.43 16 10643 16.so.16.43[.0]
243243
*
244244
* Henceforth the source version will match the shared-library major and
245245
* minor numbers; the shared-library major version number will be used for
@@ -255,9 +255,6 @@
255255
* to the info_ptr or png_ptr members through png.h, and the compiled
256256
* application is loaded with a different version of the library.
257257
*
258-
* DLLNUM will change each time there are forward or backward changes
259-
* in binary compatibility (e.g., when a new feature is added).
260-
*
261258
* See libpng.txt or libpng.3 for more information. The PNG specification
262259
* is available as a W3C Recommendation and as an ISO/IEC Standard; see
263260
* <https://www.w3.org/TR/2003/REC-PNG-20031110/>
@@ -278,19 +275,21 @@
278275
*/
279276

280277
/* Version information for png.h - this should match the version in png.c */
281-
#define PNG_LIBPNG_VER_STRING "1.6.42"
278+
#define PNG_LIBPNG_VER_STRING "1.6.43"
282279
#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
283280

284-
#define PNG_LIBPNG_VER_SONUM 16
285-
#define PNG_LIBPNG_VER_DLLNUM 16
281+
/* The versions of shared library builds should stay in sync, going forward */
282+
#define PNG_LIBPNG_VER_SHAREDLIB 16
283+
#define PNG_LIBPNG_VER_SONUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */
284+
#define PNG_LIBPNG_VER_DLLNUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */
286285

287286
/* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */
288287
#define PNG_LIBPNG_VER_MAJOR 1
289288
#define PNG_LIBPNG_VER_MINOR 6
290-
#define PNG_LIBPNG_VER_RELEASE 41
289+
#define PNG_LIBPNG_VER_RELEASE 43
291290

292291
/* This should be zero for a public release, or non-zero for a
293-
* development version. [Deprecated]
292+
* development version.
294293
*/
295294
#define PNG_LIBPNG_VER_BUILD 0
296295

@@ -318,7 +317,7 @@
318317
* From version 1.0.1 it is:
319318
* XXYYZZ, where XX=major, YY=minor, ZZ=release
320319
*/
321-
#define PNG_LIBPNG_VER 10641 /* 1.6.42 */
320+
#define PNG_LIBPNG_VER 10643 /* 1.6.43 */
322321

323322
/* Library configuration: these options cannot be changed after
324323
* the library has been built.
@@ -428,7 +427,7 @@ extern "C" {
428427
/* This triggers a compiler error in png.c, if png.c and png.h
429428
* do not agree upon the version number.
430429
*/
431-
typedef char* png_libpng_version_1_6_42;
430+
typedef char* png_libpng_version_1_6_43;
432431

433432
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
434433
*

include/support/libpng/pngconf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
/* pngconf.h - machine-configurable file for libpng
33
*
4-
* libpng version 1.6.42
4+
* libpng version 1.6.43
55
*
66
* Copyright (c) 2018-2024 Cosmin Truta
77
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson

include/support/libpng/pnglibconf.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* pnglibconf.h - library build configuration */
22

3-
/* libpng version 1.6.42 */
3+
/* libpng version 1.6.43 */
44

55
/* Copyright (c) 2018-2024 Cosmin Truta */
66
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */

libraries/libpng/png.c

Lines changed: 19 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#include "pngpriv.h"
1515

1616
/* Generate a compiler error if there is an old png.h in the search path. */
17-
typedef png_libpng_version_1_6_42 Your_png_h_is_not_version_1_6_42;
17+
typedef png_libpng_version_1_6_43 Your_png_h_is_not_version_1_6_43;
1818

1919
/* Tells libpng that we have already handled the first "num_bytes" bytes
2020
* of the PNG file signature. If the PNG data is embedded into another
@@ -794,7 +794,7 @@ png_get_copyright(png_const_structrp png_ptr)
794794
return PNG_STRING_COPYRIGHT
795795
#else
796796
return PNG_STRING_NEWLINE \
797-
"libpng version 1.6.42" PNG_STRING_NEWLINE \
797+
"libpng version 1.6.43" PNG_STRING_NEWLINE \
798798
"Copyright (c) 2018-2024 Cosmin Truta" PNG_STRING_NEWLINE \
799799
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
800800
PNG_STRING_NEWLINE \
@@ -1821,14 +1821,14 @@ png_icc_profile_error(png_const_structrp png_ptr, png_colorspacerp colorspace,
18211821
}
18221822
# ifdef PNG_WARNINGS_SUPPORTED
18231823
else
1824-
{
1825-
char number[PNG_NUMBER_BUFFER_SIZE]; /* +24 = 114 */
1824+
{
1825+
char number[PNG_NUMBER_BUFFER_SIZE]; /* +24 = 114 */
18261826

1827-
pos = png_safecat(message, (sizeof message), pos,
1828-
png_format_number(number, number+(sizeof number),
1829-
PNG_NUMBER_FORMAT_x, value));
1830-
pos = png_safecat(message, (sizeof message), pos, "h: "); /* +2 = 116 */
1831-
}
1827+
pos = png_safecat(message, (sizeof message), pos,
1828+
png_format_number(number, number+(sizeof number),
1829+
PNG_NUMBER_FORMAT_x, value));
1830+
pos = png_safecat(message, (sizeof message), pos, "h: "); /* +2 = 116 */
1831+
}
18321832
# endif
18331833
/* The 'reason' is an arbitrary message, allow +79 maximum 195 */
18341834
pos = png_safecat(message, (sizeof message), pos, reason);
@@ -2511,17 +2511,6 @@ png_colorspace_set_rgb_coefficients(png_structrp png_ptr)
25112511

25122512
#endif /* COLORSPACE */
25132513

2514-
#ifdef __GNUC__
2515-
/* This exists solely to work round a warning from GNU C. */
2516-
static int /* PRIVATE */
2517-
png_gt(size_t a, size_t b)
2518-
{
2519-
return a > b;
2520-
}
2521-
#else
2522-
# define png_gt(a,b) ((a) > (b))
2523-
#endif
2524-
25252514
void /* PRIVATE */
25262515
png_check_IHDR(png_const_structrp png_ptr,
25272516
png_uint_32 width, png_uint_32 height, int bit_depth,
@@ -2543,8 +2532,16 @@ png_check_IHDR(png_const_structrp png_ptr,
25432532
error = 1;
25442533
}
25452534

2546-
if (png_gt(((width + 7) & (~7U)),
2547-
((PNG_SIZE_MAX
2535+
/* The bit mask on the first line below must be at least as big as a
2536+
* png_uint_32. "~7U" is not adequate on 16-bit systems because it will
2537+
* be an unsigned 16-bit value. Casting to (png_alloc_size_t) makes the
2538+
* type of the result at least as bit (in bits) as the RHS of the > operator
2539+
* which also avoids a common warning on 64-bit systems that the comparison
2540+
* of (png_uint_32) against the constant value on the RHS will always be
2541+
* false.
2542+
*/
2543+
if (((width + 7) & ~(png_alloc_size_t)7) >
2544+
(((PNG_SIZE_MAX
25482545
- 48 /* big_row_buf hack */
25492546
- 1) /* filter byte */
25502547
/ 8) /* 8-byte RGBA pixels */

libraries/libpng/pngpread.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,14 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
294294
png_handle_cHRM(png_ptr, info_ptr, png_ptr->push_length);
295295
}
296296

297+
#endif
298+
#ifdef PNG_READ_eXIf_SUPPORTED
299+
else if (png_ptr->chunk_name == png_eXIf)
300+
{
301+
PNG_PUSH_SAVE_BUFFER_IF_FULL
302+
png_handle_eXIf(png_ptr, info_ptr, png_ptr->push_length);
303+
}
304+
297305
#endif
298306
#ifdef PNG_READ_sRGB_SUPPORTED
299307
else if (chunk_name == png_sRGB)

libraries/libpng/pngread.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,11 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
568568
#endif
569569

570570
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
571-
if (png_ptr->transformations || png_ptr->num_palette_max >= 0)
571+
if (png_ptr->transformations
572+
# ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
573+
|| png_ptr->num_palette_max >= 0
574+
# endif
575+
)
572576
png_do_read_transformations(png_ptr, &row_info);
573577
#endif
574578

libraries/libpng/pngrtran.c

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,13 @@ png_set_alpha_mode_fixed(png_structrp png_ptr, int mode,
297297

298298
output_gamma = translate_gamma_flags(png_ptr, output_gamma, 1/*screen*/);
299299

300-
/* Validate the value to ensure it is in a reasonable range. The value
300+
/* Validate the value to ensure it is in a reasonable range. The value
301301
* is expected to be 1 or greater, but this range test allows for some
302-
* viewing correction values. The intent is to weed out users of this API
303-
* who use the inverse of the gamma value accidentally! Since some of these
304-
* values are reasonable this may have to be changed:
302+
* viewing correction values. The intent is to weed out the API users
303+
* who might use the inverse of the gamma value accidentally!
305304
*
306-
* 1.6.x: changed from 0.07..3 to 0.01..100 (to accommodate the optimal 16-bit
307-
* gamma of 36, and its reciprocal.)
305+
* In libpng 1.6.0, we changed from 0.07..3 to 0.01..100, to accommodate
306+
* the optimal 16-bit gamma of 36 and its reciprocal.
308307
*/
309308
if (output_gamma < 1000 || output_gamma > 10000000)
310309
png_error(png_ptr, "output gamma out of expected range");
@@ -441,7 +440,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
441440
int i;
442441

443442
png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
444-
(png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
443+
(png_alloc_size_t)num_palette);
445444
for (i = 0; i < num_palette; i++)
446445
png_ptr->quantize_index[i] = (png_byte)i;
447446
}
@@ -458,7 +457,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
458457

459458
/* Initialize an array to sort colors */
460459
png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr,
461-
(png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
460+
(png_alloc_size_t)num_palette);
462461

463462
/* Initialize the quantize_sort array */
464463
for (i = 0; i < num_palette; i++)
@@ -592,11 +591,9 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
592591

593592
/* Initialize palette index arrays */
594593
png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
595-
(png_alloc_size_t)((png_uint_32)num_palette *
596-
(sizeof (png_byte))));
594+
(png_alloc_size_t)num_palette);
597595
png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
598-
(png_alloc_size_t)((png_uint_32)num_palette *
599-
(sizeof (png_byte))));
596+
(png_alloc_size_t)num_palette);
600597

601598
/* Initialize the sort array */
602599
for (i = 0; i < num_palette; i++)
@@ -761,12 +758,11 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
761758
size_t num_entries = ((size_t)1 << total_bits);
762759

763760
png_ptr->palette_lookup = (png_bytep)png_calloc(png_ptr,
764-
(png_alloc_size_t)(num_entries * (sizeof (png_byte))));
761+
(png_alloc_size_t)(num_entries));
765762

766-
distance = (png_bytep)png_malloc(png_ptr, (png_alloc_size_t)(num_entries *
767-
(sizeof (png_byte))));
763+
distance = (png_bytep)png_malloc(png_ptr, (png_alloc_size_t)num_entries);
768764

769-
memset(distance, 0xff, num_entries * (sizeof (png_byte)));
765+
memset(distance, 0xff, num_entries);
770766

771767
for (i = 0; i < num_palette; i++)
772768
{

0 commit comments

Comments
 (0)