summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEirik Aavitsland <[email protected]>2025-05-08 10:52:06 +0200
committerJani Heikkinen <[email protected]>2025-05-16 12:36:07 +0000
commit55edaffa7ccc9237523dfacde28c670a63bb66f2 (patch)
tree46dddf627a8922051a49dd6f480ea2c88dea6310
parent60cf2f867b284ab176461e013c56f613496d94eb (diff)
Update bundled libpng to version 1.6.48
[ChangeLog][Third-Party Code] libpng was updated to version 1.6.48 Change-Id: I31762d38fc15db5649623300c3e6ac8c5e79cf67 Reviewed-by: Eirik Aavitsland <[email protected]>
-rw-r--r--src/3rdparty/libpng/ANNOUNCE32
-rw-r--r--src/3rdparty/libpng/CHANGES10
-rw-r--r--src/3rdparty/libpng/README2
-rw-r--r--src/3rdparty/libpng/libpng-manual.txt6
-rw-r--r--src/3rdparty/libpng/png.c12
-rw-r--r--src/3rdparty/libpng/png.h20
-rw-r--r--src/3rdparty/libpng/pngconf.h47
-rw-r--r--src/3rdparty/libpng/pngdebug.h8
-rw-r--r--src/3rdparty/libpng/pngerror.c2
-rw-r--r--src/3rdparty/libpng/pngget.c2
-rw-r--r--src/3rdparty/libpng/pnginfo.h51
-rw-r--r--src/3rdparty/libpng/pnglibconf.h2
-rw-r--r--src/3rdparty/libpng/pngmem.c2
-rw-r--r--src/3rdparty/libpng/pngpread.c2
-rw-r--r--src/3rdparty/libpng/pngpriv.h40
-rw-r--r--src/3rdparty/libpng/pngread.c2
-rw-r--r--src/3rdparty/libpng/pngrio.c4
-rw-r--r--src/3rdparty/libpng/pngrtran.c2
-rw-r--r--src/3rdparty/libpng/pngrutil.c2
-rw-r--r--src/3rdparty/libpng/pngset.c19
-rw-r--r--src/3rdparty/libpng/pngstruct.h12
-rw-r--r--src/3rdparty/libpng/pngwio.c8
-rw-r--r--src/3rdparty/libpng/pngwrite.c2
-rw-r--r--src/3rdparty/libpng/pngwutil.c2
-rw-r--r--src/3rdparty/libpng/qt_attribution.json4
25 files changed, 138 insertions, 157 deletions
diff --git a/src/3rdparty/libpng/ANNOUNCE b/src/3rdparty/libpng/ANNOUNCE
index 603b2df48e3..15219dbb4e0 100644
--- a/src/3rdparty/libpng/ANNOUNCE
+++ b/src/3rdparty/libpng/ANNOUNCE
@@ -1,5 +1,5 @@
-libpng 1.6.47 - February 18, 2025
-=================================
+libpng 1.6.48 - April 30, 2025
+==============================
This is a public release of libpng, intended for use in production code.
@@ -9,13 +9,13 @@ Files available for download
Source files with LF line endings (for Unix/Linux):
- * libpng-1.6.47.tar.xz (LZMA-compressed, recommended)
- * libpng-1.6.47.tar.gz (deflate-compressed)
+ * libpng-1.6.48.tar.xz (LZMA-compressed, recommended)
+ * libpng-1.6.48.tar.gz (deflate-compressed)
Source files with CRLF line endings (for Windows):
- * lpng1647.7z (LZMA-compressed, recommended)
- * lpng1647.zip (deflate-compressed)
+ * lpng1648.7z (LZMA-compressed, recommended)
+ * lpng1648.zip (deflate-compressed)
Other information:
@@ -25,19 +25,17 @@ Other information:
* TRADEMARK.md
-Changes from version 1.6.46 to version 1.6.47
+Changes from version 1.6.47 to version 1.6.48
---------------------------------------------
- * Modified the behaviour of colorspace chunks in order to adhere
- to the new precedence rules formulated in the latest draft of
- the PNG Specification.
- (Contributed by John Bowler)
- * Fixed a latent bug in `png_write_iCCP`.
- This would have been a read-beyond-end-of-malloc vulnerability,
- introduced early in the libpng-1.6.0 development, yet (fortunately!)
- it was inaccessible before the above-mentioned modification of the
- colorspace precedence rules, due to pre-existing colorspace checks.
- (Reported by Bob Friesenhahn; fixed by John Bowler)
+ * 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!
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
diff --git a/src/3rdparty/libpng/CHANGES b/src/3rdparty/libpng/CHANGES
index 834b5e19277..557ff1b8c97 100644
--- a/src/3rdparty/libpng/CHANGES
+++ b/src/3rdparty/libpng/CHANGES
@@ -6251,6 +6251,16 @@ 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!
+
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
diff --git a/src/3rdparty/libpng/README b/src/3rdparty/libpng/README
index 57952fb215a..cbde7246ca2 100644
--- a/src/3rdparty/libpng/README
+++ b/src/3rdparty/libpng/README
@@ -1,4 +1,4 @@
-README for libpng version 1.6.47
+README for libpng version 1.6.48
================================
See the note about version numbers near the top of `png.h`.
diff --git a/src/3rdparty/libpng/libpng-manual.txt b/src/3rdparty/libpng/libpng-manual.txt
index 862fe2c5d0f..940c2e2b513 100644
--- a/src/3rdparty/libpng/libpng-manual.txt
+++ b/src/3rdparty/libpng/libpng-manual.txt
@@ -9,7 +9,7 @@ libpng-manual.txt - A description on how to use and modify libpng
Based on:
- libpng version 1.6.36, December 2018, through 1.6.47 - February 2025
+ libpng version 1.6.36, December 2018, through 1.6.48 - April 2025
Updated and distributed by Cosmin Truta
Copyright (c) 2018-2025 Cosmin Truta
@@ -4089,7 +4089,7 @@ READ APIs
is filled in from the PNG header in the file.
int png_image_begin_read_from_stdio (png_imagep image,
- FILE* file)
+ FILE *file)
The PNG header is read from the stdio FILE object.
@@ -4164,7 +4164,7 @@ be written:
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.
With all write APIs if image is in one of the linear formats with
(png_uint_16) data then setting convert_to_8_bit will cause the output to be
diff --git a/src/3rdparty/libpng/png.c b/src/3rdparty/libpng/png.c
index 6d533ec40b4..a9179ffbbdd 100644
--- a/src/3rdparty/libpng/png.c
+++ b/src/3rdparty/libpng/png.c
@@ -13,7 +13,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_48 Your_png_h_is_not_version_1_6_48;
/* Sanity check the chunks definitions - PNG_KNOWN_CHUNKS from pngpriv.h and the
* corresponding macro definitions. This causes a compile time failure if
@@ -700,7 +700,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");
@@ -815,7 +815,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.48" 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 \
@@ -1491,7 +1491,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)
@@ -1567,9 +1567,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:
*
@@ -3969,7 +3967,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. */
diff --git a/src/3rdparty/libpng/png.h b/src/3rdparty/libpng/png.h
index 9b069e4ee89..665511c5547 100644
--- a/src/3rdparty/libpng/png.h
+++ b/src/3rdparty/libpng/png.h
@@ -1,6 +1,6 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.6.47
+ * libpng version 1.6.48
*
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson
@@ -14,7 +14,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.48, April 2025:
* Cosmin Truta
* See also "Contributing Authors", below.
*/
@@ -238,7 +238,7 @@
* ...
* 1.5.30 15 10530 15.so.15.30[.0]
* ...
- * 1.6.47 16 10647 16.so.16.47[.0]
+ * 1.6.48 16 10648 16.so.16.48[.0]
*
* Henceforth the source version will match the shared-library major and
* minor numbers; the shared-library major version number will be used for
@@ -274,7 +274,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.48"
#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
/* The versions of shared library builds should stay in sync, going forward */
@@ -285,7 +285,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 48
/* This should be zero for a public release, or non-zero for a
* development version.
@@ -316,7 +316,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 10648 /* 1.6.48 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -426,7 +426,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_48;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
@@ -1570,7 +1570,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
@@ -3088,7 +3088,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 */
@@ -3163,7 +3163,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
diff --git a/src/3rdparty/libpng/pngconf.h b/src/3rdparty/libpng/pngconf.h
index 42fa973c206..e46b0611190 100644
--- a/src/3rdparty/libpng/pngconf.h
+++ b/src/3rdparty/libpng/pngconf.h
@@ -1,6 +1,6 @@
/* pngconf.h - machine-configurable file for libpng
*
- * libpng version 1.6.47
+ * libpng version 1.6.48
*
* Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson
@@ -219,25 +219,13 @@
/* NOTE: PNGCBAPI always defaults to PNGCAPI. */
# if defined(PNGAPI) && !defined(PNG_USER_PRIVATEBUILD)
-# error "PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed"
+# error PNG_USER_PRIVATEBUILD must be defined if PNGAPI is changed
# endif
-# if (defined(_MSC_VER) && _MSC_VER < 800) ||\
- (defined(__BORLANDC__) && __BORLANDC__ < 0x500)
- /* older Borland and MSC
- * compilers used '__export' and required this to be after
- * the type.
- */
-# ifndef PNG_EXPORT_TYPE
-# define PNG_EXPORT_TYPE(type) type PNG_IMPEXP
-# endif
-# define PNG_DLL_EXPORT __export
-# else /* newer compiler */
-# define PNG_DLL_EXPORT __declspec(dllexport)
-# ifndef PNG_DLL_IMPORT
-# define PNG_DLL_IMPORT __declspec(dllimport)
-# endif
-# endif /* compiler */
+# define PNG_DLL_EXPORT __declspec(dllexport)
+# ifndef PNG_DLL_IMPORT
+# define PNG_DLL_IMPORT __declspec(dllimport)
+# endif
#else /* !Windows */
# if (defined(__IBMC__) || defined(__IBMCPP__)) && defined(__OS2__)
@@ -479,7 +467,7 @@
#if CHAR_BIT == 8 && UCHAR_MAX == 255
typedef unsigned char png_byte;
#else
-# error "libpng requires 8-bit bytes"
+# error libpng requires 8-bit bytes
#endif
#if INT_MIN == -32768 && INT_MAX == 32767
@@ -487,7 +475,7 @@
#elif SHRT_MIN == -32768 && SHRT_MAX == 32767
typedef short png_int_16;
#else
-# error "libpng requires a signed 16-bit type"
+# error libpng requires a signed 16-bit integer type
#endif
#if UINT_MAX == 65535
@@ -495,7 +483,7 @@
#elif USHRT_MAX == 65535
typedef unsigned short png_uint_16;
#else
-# error "libpng requires an unsigned 16-bit type"
+# error libpng requires an unsigned 16-bit integer type
#endif
#if INT_MIN < -2147483646 && INT_MAX > 2147483646
@@ -503,7 +491,7 @@
#elif LONG_MIN < -2147483646 && LONG_MAX > 2147483646
typedef long int png_int_32;
#else
-# error "libpng requires a signed 32-bit (or more) type"
+# error libpng requires a signed 32-bit (or longer) integer type
#endif
#if UINT_MAX > 4294967294U
@@ -511,7 +499,7 @@
#elif ULONG_MAX > 4294967294U
typedef unsigned long int png_uint_32;
#else
-# error "libpng requires an unsigned 32-bit (or more) type"
+# error libpng requires an unsigned 32-bit (or longer) integer type
#endif
/* Prior to 1.6.0, it was possible to disable the use of size_t and ptrdiff_t.
@@ -592,10 +580,6 @@ typedef const png_fixed_point * png_const_fixed_point_p;
typedef size_t * png_size_tp;
typedef const size_t * png_const_size_tp;
-#ifdef PNG_STDIO_SUPPORTED
-typedef FILE * png_FILE_p;
-#endif
-
#ifdef PNG_FLOATING_POINT_SUPPORTED
typedef double * png_doublep;
typedef const double * png_const_doublep;
@@ -617,6 +601,15 @@ typedef double * * png_doublepp;
/* Pointers to pointers to pointers; i.e., pointer to array */
typedef char * * * png_charppp;
+#ifdef PNG_STDIO_SUPPORTED
+/* With PNG_STDIO_SUPPORTED it was possible to use I/O streams that were
+ * not necessarily stdio FILE streams, to allow building Windows applications
+ * before Win32 and Windows CE applications before WinCE 3.0, but that kind
+ * of support has long been discontinued.
+ */
+typedef FILE * png_FILE_p; /* [Deprecated] */
+#endif
+
#endif /* PNG_BUILDING_SYMBOL_TABLE */
#endif /* PNGCONF_H */
diff --git a/src/3rdparty/libpng/pngdebug.h b/src/3rdparty/libpng/pngdebug.h
index ab9ea632d91..af1ae9e8212 100644
--- a/src/3rdparty/libpng/pngdebug.h
+++ b/src/3rdparty/libpng/pngdebug.h
@@ -1,6 +1,6 @@
-/* pngdebug.h - Debugging macros for libpng, also used in pngtest.c
+/* pngdebug.h - internal debugging macros for libpng
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2013 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -10,6 +10,10 @@
* and license in png.h
*/
+#ifndef PNGPRIV_H
+# error This file must not be included by applications; please include <png.h>
+#endif
+
/* Define PNG_DEBUG at compile time for debugging information. Higher
* numbers for PNG_DEBUG mean more debugging information. This has
* only been added since version 0.95 so it is not implemented throughout
diff --git a/src/3rdparty/libpng/pngerror.c b/src/3rdparty/libpng/pngerror.c
index 275b188d040..01a7ef5347e 100644
--- a/src/3rdparty/libpng/pngerror.c
+++ b/src/3rdparty/libpng/pngerror.c
@@ -1,6 +1,6 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
diff --git a/src/3rdparty/libpng/pngget.c b/src/3rdparty/libpng/pngget.c
index 3623c5c7c32..1ebb1144ffc 100644
--- a/src/3rdparty/libpng/pngget.c
+++ b/src/3rdparty/libpng/pngget.c
@@ -1,6 +1,6 @@
/* pngget.c - retrieval of values from info struct
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 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.
diff --git a/src/3rdparty/libpng/pnginfo.h b/src/3rdparty/libpng/pnginfo.h
index c2a907bc587..584a42f9568 100644
--- a/src/3rdparty/libpng/pnginfo.h
+++ b/src/3rdparty/libpng/pnginfo.h
@@ -1,6 +1,6 @@
-/* pnginfo.h - header file for PNG reference library
+/* pnginfo.h - internal structures for libpng
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2013,2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -10,43 +10,20 @@
* and license in png.h
*/
- /* png_info is a structure that holds the information in a PNG file so
- * that the application can find out the characteristics of the image.
- * If you are reading the file, this structure will tell you what is
- * in the PNG file. If you are writing the file, fill in the information
- * you want to put into the PNG file, using png_set_*() functions, then
- * call png_write_info().
- *
- * The names chosen should be very close to the PNG specification, so
- * consult that document for information about the meaning of each field.
- *
- * With libpng < 0.95, it was only possible to directly set and read the
- * the values in the png_info_struct, which meant that the contents and
- * order of the values had to remain fixed. With libpng 0.95 and later,
- * however, there are now functions that abstract the contents of
- * png_info_struct from the application, so this makes it easier to use
- * libpng with dynamic libraries, and even makes it possible to use
- * libraries that don't have all of the libpng ancillary chunk-handing
- * functionality. In libpng-1.5.0 this was moved into a separate private
- * file that is not visible to applications.
+#ifndef PNGPRIV_H
+# error This file must not be included by applications; please include <png.h>
+#endif
+
+/* INTERNAL, PRIVATE definition of a PNG.
*
- * The following members may have allocated storage attached that should be
- * cleaned up before the structure is discarded: palette, trans, text,
- * pcal_purpose, pcal_units, pcal_params, hist, iccp_name, iccp_profile,
- * splt_palettes, scal_unit, row_pointers, and unknowns. By default, these
- * are automatically freed when the info structure is deallocated, if they were
- * allocated internally by libpng. This behavior can be changed by means
- * of the png_data_freer() function.
+ * png_info is a modifiable description of a PNG datastream. The fields inside
+ * this structure are accessed through png_get_<CHUNK>() functions and modified
+ * using png_set_<CHUNK>() functions.
*
- * More allocation details: all the chunk-reading functions that
- * change these members go through the corresponding png_set_*
- * functions. A function to clear these members is available: see
- * png_free_data(). The png_set_* functions do not depend on being
- * able to point info structure members to any of the storage they are
- * passed (they make their own copies), EXCEPT that the png_set_text
- * functions use the same storage passed to them in the text_ptr or
- * itxt_ptr structure argument, and the png_set_rows and png_set_unknowns
- * functions do not make their own copies.
+ * Some functions in libpng do directly access members of png_info. However,
+ * this should be avoided. png_struct objects contain members which hold
+ * caches, sometimes optimised, of the values from png_info objects, and
+ * png_info is not passed to the functions which read and write image data.
*/
#ifndef PNGINFO_H
#define PNGINFO_H
diff --git a/src/3rdparty/libpng/pnglibconf.h b/src/3rdparty/libpng/pnglibconf.h
index 748220bfc1c..c7634440de8 100644
--- a/src/3rdparty/libpng/pnglibconf.h
+++ b/src/3rdparty/libpng/pnglibconf.h
@@ -1,6 +1,6 @@
/* pnglibconf.h - library build configuration */
-/* libpng version 1.6.47 */
+/* libpng version 1.6.48 */
/* Copyright (c) 2018-2025 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
diff --git a/src/3rdparty/libpng/pngmem.c b/src/3rdparty/libpng/pngmem.c
index 90c13b10684..71e61c99f79 100644
--- a/src/3rdparty/libpng/pngmem.c
+++ b/src/3rdparty/libpng/pngmem.c
@@ -1,6 +1,6 @@
/* pngmem.c - stub functions for memory allocation
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2014,2016 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
diff --git a/src/3rdparty/libpng/pngpread.c b/src/3rdparty/libpng/pngpread.c
index 60d810693b3..0a3e822cf47 100644
--- a/src/3rdparty/libpng/pngpread.c
+++ b/src/3rdparty/libpng/pngpread.c
@@ -1,6 +1,6 @@
/* pngpread.c - read a png file in push mode
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 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.
diff --git a/src/3rdparty/libpng/pngpriv.h b/src/3rdparty/libpng/pngpriv.h
index d514dff5c16..a6f8d67d384 100644
--- a/src/3rdparty/libpng/pngpriv.h
+++ b/src/3rdparty/libpng/pngpriv.h
@@ -1,6 +1,6 @@
/* pngpriv.h - private declarations for use inside libpng
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 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.
@@ -19,8 +19,20 @@
* they should be well aware of the issues that may arise from doing so.
*/
+
+/* pngpriv.h must be included first in each translation unit inside libpng.
+ * On the other hand, it must not be included at all, directly or indirectly,
+ * by any application code that uses the libpng API.
+ */
#ifndef PNGPRIV_H
-#define PNGPRIV_H
+# define PNGPRIV_H
+#else
+# error Duplicate inclusion of pngpriv.h; please check the libpng source files
+#endif
+
+#if defined(PNG_H) || defined(PNGCONF_H) || defined(PNGLCONF_H)
+# error This file must not be included by applications; please include <png.h>
+#endif
/* Feature Test Macros. The following are defined here to ensure that correctly
* implemented libraries reveal the APIs libpng needs to build and hide those
@@ -57,7 +69,6 @@
*/
#if defined(HAVE_CONFIG_H) && !defined(PNG_NO_CONFIG_H)
# include <config.h>
-
/* Pick up the definition of 'restrict' from config.h if it was read: */
# define PNG_RESTRICT restrict
#endif
@@ -67,9 +78,7 @@
* are not internal definitions may be required. This is handled below just
* before png.h is included, but load the configuration now if it is available.
*/
-#ifndef PNGLCONF_H
-# include "pnglibconf.h"
-#endif
+#include "pnglibconf.h"
/* Local renames may change non-exported API functions from png.h */
#if defined(PNG_PREFIX) && !defined(PNGPREFIX_H)
@@ -991,17 +1000,15 @@
* must match that used in the build, or we must be using pnglibconf.h.prebuilt:
*/
#if PNG_ZLIB_VERNUM != 0 && PNG_ZLIB_VERNUM != ZLIB_VERNUM
-# error ZLIB_VERNUM != PNG_ZLIB_VERNUM \
- "-I (include path) error: see the notes in pngpriv.h"
- /* This means that when pnglibconf.h was built the copy of zlib.h that it
- * used is not the same as the one being used here. Because the build of
- * libpng makes decisions to use inflateInit2 and inflateReset2 based on the
- * zlib version number and because this affects handling of certain broken
- * PNG files the -I directives must match.
+# error The include path of <zlib.h> is incorrect
+ /* When pnglibconf.h was built, the copy of zlib.h that it used was not the
+ * same as the one being used here. Considering how libpng makes decisions
+ * to use the zlib API based on the zlib version number, the -I options must
+ * match.
*
- * The most likely explanation is that you passed a -I in CFLAGS. This will
- * not work; all the preprocessor directives and in particular all the -I
- * directives must be in CPPFLAGS.
+ * A possible cause of this mismatch is that you passed an -I option in
+ * CFLAGS, which is unlikely to work. All the preprocessor options, and all
+ * the -I options in particular, should be in CPPFLAGS.
*/
#endif
@@ -2162,4 +2169,3 @@ PNG_INTERNAL_FUNCTION(int,
#endif
#endif /* PNG_VERSION_INFO_ONLY */
-#endif /* PNGPRIV_H */
diff --git a/src/3rdparty/libpng/pngread.c b/src/3rdparty/libpng/pngread.c
index 0fd364827eb..4f55f6408b8 100644
--- a/src/3rdparty/libpng/pngread.c
+++ b/src/3rdparty/libpng/pngread.c
@@ -1328,7 +1328,7 @@ png_image_read_header(png_voidp argument)
#ifdef PNG_STDIO_SUPPORTED
int PNGAPI
-png_image_begin_read_from_stdio(png_imagep image, FILE* file)
+png_image_begin_read_from_stdio(png_imagep image, FILE *file)
{
if (image != NULL && image->version == PNG_IMAGE_VERSION)
{
diff --git a/src/3rdparty/libpng/pngrio.c b/src/3rdparty/libpng/pngrio.c
index 3b137f275f8..b4a216161be 100644
--- a/src/3rdparty/libpng/pngrio.c
+++ b/src/3rdparty/libpng/pngrio.c
@@ -1,6 +1,6 @@
/* pngrio.c - functions for data input
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2025 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.
@@ -56,7 +56,7 @@ png_default_read_data(png_structp png_ptr, png_bytep data, size_t length)
/* fread() returns 0 on error, so it is OK to store this in a size_t
* instead of an int, which is what fread() actually returns.
*/
- check = fread(data, 1, length, png_voidcast(png_FILE_p, png_ptr->io_ptr));
+ check = fread(data, 1, length, png_voidcast(FILE *, png_ptr->io_ptr));
if (check != length)
png_error(png_ptr, "Read Error");
diff --git a/src/3rdparty/libpng/pngrtran.c b/src/3rdparty/libpng/pngrtran.c
index a6ce30a5231..0fea13a418d 100644
--- a/src/3rdparty/libpng/pngrtran.c
+++ b/src/3rdparty/libpng/pngrtran.c
@@ -1,6 +1,6 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 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.
diff --git a/src/3rdparty/libpng/pngrutil.c b/src/3rdparty/libpng/pngrutil.c
index d0f3ed35d2d..7d9a00186dc 100644
--- a/src/3rdparty/libpng/pngrutil.c
+++ b/src/3rdparty/libpng/pngrutil.c
@@ -1,6 +1,6 @@
/* pngrutil.c - utilities to read a PNG file
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 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.
diff --git a/src/3rdparty/libpng/pngset.c b/src/3rdparty/libpng/pngset.c
index d7f3393c437..3e63c2724ec 100644
--- a/src/3rdparty/libpng/pngset.c
+++ b/src/3rdparty/libpng/pngset.c
@@ -300,17 +300,14 @@ png_set_mDCV(png_const_structrp png_ptr, png_inforp info_ptr,
double maxDL, double minDL)
{
png_set_mDCV_fixed(png_ptr, info_ptr,
- /* The ITU approach is to scale by 50,000, not 100,000 so just divide
- * the input values by 2 and use png_fixed:
- */
- png_fixed(png_ptr, white_x / 2, "png_set_mDCV(white(x))"),
- png_fixed(png_ptr, white_y / 2, "png_set_mDCV(white(y))"),
- png_fixed(png_ptr, red_x / 2, "png_set_mDCV(red(x))"),
- png_fixed(png_ptr, red_y / 2, "png_set_mDCV(red(y))"),
- png_fixed(png_ptr, green_x / 2, "png_set_mDCV(green(x))"),
- png_fixed(png_ptr, green_y / 2, "png_set_mDCV(green(y))"),
- png_fixed(png_ptr, blue_x / 2, "png_set_mDCV(blue(x))"),
- png_fixed(png_ptr, blue_y / 2, "png_set_mDCV(blue(y))"),
+ png_fixed(png_ptr, white_x, "png_set_mDCV(white(x))"),
+ png_fixed(png_ptr, white_y, "png_set_mDCV(white(y))"),
+ png_fixed(png_ptr, red_x, "png_set_mDCV(red(x))"),
+ png_fixed(png_ptr, red_y, "png_set_mDCV(red(y))"),
+ png_fixed(png_ptr, green_x, "png_set_mDCV(green(x))"),
+ png_fixed(png_ptr, green_y, "png_set_mDCV(green(y))"),
+ png_fixed(png_ptr, blue_x, "png_set_mDCV(blue(x))"),
+ png_fixed(png_ptr, blue_y, "png_set_mDCV(blue(y))"),
png_fixed_ITU(png_ptr, maxDL, "png_set_mDCV(maxDL)"),
png_fixed_ITU(png_ptr, minDL, "png_set_mDCV(minDL)"));
}
diff --git a/src/3rdparty/libpng/pngstruct.h b/src/3rdparty/libpng/pngstruct.h
index 324424495e4..b17a54fe8f9 100644
--- a/src/3rdparty/libpng/pngstruct.h
+++ b/src/3rdparty/libpng/pngstruct.h
@@ -1,6 +1,6 @@
-/* pngstruct.h - header file for PNG reference library
+/* pngstruct.h - internal structures for libpng
*
- * Copyright (c) 2018-2022 Cosmin Truta
+ * Copyright (c) 2018-2025 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.
@@ -10,11 +10,9 @@
* and license in png.h
*/
-/* The structure that holds the information to read and write PNG files.
- * The only people who need to care about what is inside of this are the
- * people who will be modifying the library for their own special needs.
- * It should NOT be accessed directly by an application.
- */
+#ifndef PNGPRIV_H
+# error This file must not be included by applications; please include <png.h>
+#endif
#ifndef PNGSTRUCT_H
#define PNGSTRUCT_H
diff --git a/src/3rdparty/libpng/pngwio.c b/src/3rdparty/libpng/pngwio.c
index 38c9c006cb1..96a3187ff01 100644
--- a/src/3rdparty/libpng/pngwio.c
+++ b/src/3rdparty/libpng/pngwio.c
@@ -1,6 +1,6 @@
/* pngwio.c - functions for data output
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2025 Cosmin Truta
* Copyright (c) 1998-2002,2004,2006-2014,2016,2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -54,7 +54,7 @@ png_default_write_data(png_structp png_ptr, png_bytep data, size_t length)
if (png_ptr == NULL)
return;
- check = fwrite(data, 1, length, (png_FILE_p)(png_ptr->io_ptr));
+ check = fwrite(data, 1, length, (FILE *)png_ptr->io_ptr);
if (check != length)
png_error(png_ptr, "Write Error");
@@ -77,12 +77,12 @@ png_flush(png_structrp png_ptr)
void PNGCBAPI
png_default_flush(png_structp png_ptr)
{
- png_FILE_p io_ptr;
+ FILE *io_ptr;
if (png_ptr == NULL)
return;
- io_ptr = png_voidcast(png_FILE_p, (png_ptr->io_ptr));
+ io_ptr = png_voidcast(FILE *, png_ptr->io_ptr);
fflush(io_ptr);
}
# endif
diff --git a/src/3rdparty/libpng/pngwrite.c b/src/3rdparty/libpng/pngwrite.c
index b7aeff4ce4a..35a5d17b601 100644
--- a/src/3rdparty/libpng/pngwrite.c
+++ b/src/3rdparty/libpng/pngwrite.c
@@ -2333,7 +2333,7 @@ int PNGAPI
png_image_write_to_stdio(png_imagep image, FILE *file, int convert_to_8bit,
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. */
if (image != NULL && image->version == PNG_IMAGE_VERSION)
{
if (file != NULL && buffer != NULL)
diff --git a/src/3rdparty/libpng/pngwutil.c b/src/3rdparty/libpng/pngwutil.c
index be706afe640..863ffe8c2fb 100644
--- a/src/3rdparty/libpng/pngwutil.c
+++ b/src/3rdparty/libpng/pngwutil.c
@@ -1,6 +1,6 @@
/* pngwutil.c - utilities to write a PNG file
*
- * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2018-2025 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.
diff --git a/src/3rdparty/libpng/qt_attribution.json b/src/3rdparty/libpng/qt_attribution.json
index e36589f50f0..d300d9d9b52 100644
--- a/src/3rdparty/libpng/qt_attribution.json
+++ b/src/3rdparty/libpng/qt_attribution.json
@@ -7,8 +7,8 @@
"Description": "libpng is the official PNG reference library.",
"Homepage": "http://www.libpng.org/pub/png/libpng.html",
- "Version": "1.6.47",
- "DownloadLocation": "https://download.sourceforge.net/libpng/libpng-1.6.47.tar.xz",
+ "Version": "1.6.48",
+ "DownloadLocation": "https://download.sourceforge.net/libpng/libpng-1.6.48.tar.xz",
"PURL": "pkg:github/pnggroup/libpng@v$<VERSION>",
"CPE": "cpe:2.3:a:libpng:libpng:$<VERSION>:*:*:*:*:*:*:*",