aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2025-01-09 18:55:39 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2025-01-09 19:09:32 +0300
commit938eb92a49988b4a9a3453b6b69993a019441a73 (patch)
tree7cbb90945b58215f0e601ad565f0fcaac1a0b1b3
parent4a628878c02d16a2628e30473b245a2323acb3bc (diff)
downloadydb-938eb92a49988b4a9a3453b6b69993a019441a73.tar.gz
Intermediate changes
commit_hash:42e7d17058f299243aa02f578cb643c267c7d7e3
-rw-r--r--contrib/libs/libpng/.yandex_meta/__init__.py1
-rw-r--r--contrib/libs/libpng/.yandex_meta/devtools.copyrights.report90
-rw-r--r--contrib/libs/libpng/.yandex_meta/devtools.licenses.report78
-rw-r--r--contrib/libs/libpng/.yandex_meta/licenses.list.txt72
-rw-r--r--contrib/libs/libpng/.yandex_meta/override.nix4
-rw-r--r--contrib/libs/libpng/ANNOUNCE40
-rw-r--r--contrib/libs/libpng/AUTHORS31
-rw-r--r--contrib/libs/libpng/CHANGES89
-rw-r--r--contrib/libs/libpng/LICENSE4
-rw-r--r--contrib/libs/libpng/README12
-rw-r--r--contrib/libs/libpng/arm/filter_neon.S266
-rw-r--r--contrib/libs/libpng/mips/filter_mmi_inline_assembly.c525
-rw-r--r--contrib/libs/libpng/mips/filter_msa_intrinsics.c14
-rw-r--r--contrib/libs/libpng/mips/mips_init.c86
-rw-r--r--contrib/libs/libpng/patches/apng.patch7
-rw-r--r--contrib/libs/libpng/patches/clang-18.patch26
-rw-r--r--contrib/libs/libpng/png.c207
-rw-r--r--contrib/libs/libpng/png.h73
-rw-r--r--contrib/libs/libpng/pngconf.h10
-rw-r--r--contrib/libs/libpng/pngerror.c43
-rw-r--r--contrib/libs/libpng/pngget.c245
-rw-r--r--contrib/libs/libpng/pnglibconf.h9
-rw-r--r--contrib/libs/libpng/pngpread.c16
-rw-r--r--contrib/libs/libpng/pngpriv.h162
-rw-r--r--contrib/libs/libpng/pngread.c12
-rw-r--r--contrib/libs/libpng/pngrtran.c34
-rw-r--r--contrib/libs/libpng/pngrutil.c19
-rw-r--r--contrib/libs/libpng/pngset.c22
-rw-r--r--contrib/libs/libpng/pngtrans.c14
-rw-r--r--contrib/libs/libpng/pngwrite.c19
-rw-r--r--contrib/libs/libpng/pngwutil.c10
-rw-r--r--contrib/libs/libpng/ya.make6
32 files changed, 1396 insertions, 850 deletions
diff --git a/contrib/libs/libpng/.yandex_meta/__init__.py b/contrib/libs/libpng/.yandex_meta/__init__.py
index 0e0556b959..6dbbc897ae 100644
--- a/contrib/libs/libpng/.yandex_meta/__init__.py
+++ b/contrib/libs/libpng/.yandex_meta/__init__.py
@@ -45,6 +45,7 @@ libpng = GNUMakeNixProject(
"config.h",
"pngusr.h",
"mem.h",
+ "PNG_MIPS_MMI_FILE",
"PNG_MIPS_MSA_FILE",
"PNG_POWERPC_VSX_FILE",
"PNG_ARM_NEON_FILE",
diff --git a/contrib/libs/libpng/.yandex_meta/devtools.copyrights.report b/contrib/libs/libpng/.yandex_meta/devtools.copyrights.report
index 943f1a9a9d..9c2b4afd51 100644
--- a/contrib/libs/libpng/.yandex_meta/devtools.copyrights.report
+++ b/contrib/libs/libpng/.yandex_meta/devtools.copyrights.report
@@ -65,7 +65,7 @@ BELONGS ya.make
powerpc/filter_vsx_intrinsics.c [3:5]
powerpc/powerpc_init.c [4:6]
-KEEP COPYRIGHT_SERVICE_LABEL 1fce79adc0eb0ee5300ea0b88074c406
+KEEP COPYRIGHT_SERVICE_LABEL 2210a81b65840c39738f253134eca011
BELONGS ya.make
Note: matched license text is too long. Read it in the source files.
Scancode info:
@@ -133,19 +133,13 @@ BELONGS ya.make
Score : 100.00
Match type : COPYRIGHT
Files with this license:
- arm/filter_neon.S [4:6]
arm/filter_neon_intrinsics.c [4:7]
intel/filter_sse2_intrinsics.c [4:7]
intel/intel_init.c [4:7]
- mips/filter_msa_intrinsics.c [4:6]
- mips/mips_init.c [4:6]
pngdebug.h [4:7]
- pngerror.c [4:7]
pnginfo.h [4:7]
pngmem.c [4:7]
- pngpread.c [4:7]
pngrio.c [4:7]
- pngtrans.c [4:7]
pngwio.c [4:7]
pngwtran.c [4:7]
powerpc/filter_vsx_intrinsics.c [3:5]
@@ -178,25 +172,6 @@ BELONGS ya.make
intel/filter_sse2_intrinsics.c [4:7]
intel/intel_init.c [4:7]
-KEEP COPYRIGHT_SERVICE_LABEL 4d7193940d3da830ff7edc9e1ecaaee6
-BELONGS ya.make
- Note: matched license text is too long. Read it in the source files.
- Scancode info:
- Original SPDX id: COPYRIGHT_SERVICE_LABEL
- Score : 100.00
- Match type : COPYRIGHT
- Files with this license:
- LICENSE [13:17]
- png.c [4:7]
- png.c [819:825]
- png.h [6:9]
- png.h [36:40]
- pngget.c [4:7]
- pnglibconf.h [5:6]
- pngpriv.h [4:7]
- pngset.c [4:7]
- pngwrite.c [4:7]
-
KEEP COPYRIGHT_SERVICE_LABEL 51b32ca44bdc2a734f625cee7a36472b
BELONGS ya.make
Note: matched license text is too long. Read it in the source files.
@@ -206,10 +181,7 @@ BELONGS ya.make
Match type : COPYRIGHT
Files with this license:
arm/arm_init.c [4:6]
- pngconf.h [6:9]
- pngrutil.c [4:7]
pngstruct.h [4:7]
- pngwutil.c [4:7]
KEEP COPYRIGHT_SERVICE_LABEL 5fc45730df09b1e4ad9f9d6a2d097232
BELONGS ya.make
@@ -236,7 +208,7 @@ BELONGS ya.make
LICENSE [13:17]
LICENSE [87:91]
png.c [4:7]
- png.c [819:825]
+ png.c [798:804]
png.h [6:9]
png.h [36:40]
png.h [110:114]
@@ -260,6 +232,18 @@ BELONGS ya.make
pngwtran.c [4:7]
pngwutil.c [4:7]
+KEEP COPYRIGHT_SERVICE_LABEL 7e44d6c54a35ce9344b977e884ef180c
+BELONGS ya.make
+ License text:
+ * Copyright (c) 2024 Cosmin Truta
+ Scancode info:
+ Original SPDX id: COPYRIGHT_SERVICE_LABEL
+ Score : 100.00
+ Match type : COPYRIGHT
+ Files with this license:
+ arm/filter_neon.S [4:4]
+ mips/filter_mmi_inline_assembly.c [3:4]
+
KEEP COPYRIGHT_SERVICE_LABEL 9198506c7cb59dc577addf9c14d6ade1
BELONGS ya.make
Note: matched license text is too long. Read it in the source files.
@@ -269,7 +253,7 @@ BELONGS ya.make
Match type : COPYRIGHT
Files with this license:
png.c [4:7]
- png.c [819:825]
+ png.c [798:804]
png.h [6:9]
pngget.c [4:7]
pnglibconf.h [5:6]
@@ -297,18 +281,34 @@ BELONGS ya.make
LICENSE [6:8]
png.h [29:31]
-KEEP COPYRIGHT_SERVICE_LABEL a590c93284482861546eac4b62974abf
+KEEP COPYRIGHT_SERVICE_LABEL a8a352211455dc7608a2fcc17b1d1029
BELONGS ya.make
- License text:
- * Copyright (c) 2018 Cosmin Truta
- * Copyright (c) 2014,2017 Glenn Randers-Pehrson
- * Written by Mans Rullgard, 2011.
+ Note: matched license text is too long. Read it in the source files.
Scancode info:
Original SPDX id: COPYRIGHT_SERVICE_LABEL
Score : 100.00
Match type : COPYRIGHT
Files with this license:
- arm/filter_neon.S [4:6]
+ LICENSE [13:17]
+ mips/filter_msa_intrinsics.c [4:6]
+ mips/mips_init.c [4:7]
+ png.c [4:7]
+ png.c [798:804]
+ png.h [6:9]
+ png.h [36:40]
+ pngconf.h [6:9]
+ pngerror.c [4:7]
+ pngget.c [4:7]
+ pnglibconf.h [5:6]
+ pngpread.c [4:7]
+ pngpriv.h [4:7]
+ pngread.c [4:7]
+ pngrtran.c [4:7]
+ pngrutil.c [4:7]
+ pngset.c [4:7]
+ pngtrans.c [4:7]
+ pngwrite.c [4:7]
+ pngwutil.c [4:7]
KEEP COPYRIGHT_SERVICE_LABEL a9fe2e1b3b86d7489fcd47a2c9749dfe
BELONGS ya.make
@@ -321,7 +321,7 @@ BELONGS ya.make
LICENSE [13:17]
LICENSE [103:104]
png.c [4:7]
- png.c [819:825]
+ png.c [798:804]
png.h [6:9]
png.h [36:40]
png.h [126:127]
@@ -347,20 +347,20 @@ BELONGS ya.make
KEEP COPYRIGHT_SERVICE_LABEL b585c8f7e4acf8c0948a1fd9ab5daaaa
BELONGS ya.make
- Note: matched license text is too long. Read it in the source files.
+ License text:
+ * Copyright (c) 2018-2019 Cosmin Truta
+ * Copyright (c) 2017-2018 Arm Holdings. All rights reserved.
Scancode info:
Original SPDX id: COPYRIGHT_SERVICE_LABEL
Score : 100.00
Match type : COPYRIGHT
Files with this license:
arm/palette_neon_intrinsics.c [4:5]
- pngread.c [4:7]
- pngrtran.c [4:7]
KEEP COPYRIGHT_SERVICE_LABEL b91f4788e32d0095f31d9f6910440991
BELONGS ya.make
License text:
- * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 1998-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -431,13 +431,13 @@ BELONGS ya.make
KEEP COPYRIGHT_SERVICE_LABEL e8596f616c40e549d2ea24adacc49cf7
BELONGS ya.make
License text:
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 2016 Glenn Randers-Pehrson
- * Written by Mandar Sahastrabuddhe, August 2016.
+ * Written by Mandar Sahastrabuddhe, August 2016
Scancode info:
Original SPDX id: COPYRIGHT_SERVICE_LABEL
Score : 100.00
Match type : COPYRIGHT
Files with this license:
mips/filter_msa_intrinsics.c [4:6]
- mips/mips_init.c [4:6]
+ mips/mips_init.c [4:7]
diff --git a/contrib/libs/libpng/.yandex_meta/devtools.licenses.report b/contrib/libs/libpng/.yandex_meta/devtools.licenses.report
index 90b3c5d0b6..52148e46d8 100644
--- a/contrib/libs/libpng/.yandex_meta/devtools.licenses.report
+++ b/contrib/libs/libpng/.yandex_meta/devtools.licenses.report
@@ -29,20 +29,6 @@
# FILE_INCLUDE - include all file data into licenses text file
# =======================
-SKIP LicenseRef-scancode-free-unknown 0245dc9406ea6d91bc41a0b69235973f
-BELONGS ya.make
- # we have no contrib in libpng directory
- License text:
- that are distributed with libpng, have other copyright owners, and are
- released under other open source licenses.
- Scancode info:
- Original SPDX id: LicenseRef-scancode-free-unknown
- Score : 100.00
- Match type : NOTICE
- Links : https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/free-unknown.LICENSE
- Files with this license:
- AUTHORS [51:52]
-
KEEP Libpng 147dc0e952990823ef472540ecd32e49
BELONGS ya.make
FILE_INCLUDE TRADEMARK found in files: TRADEMARK at line 1
@@ -120,8 +106,8 @@ BELONGS ya.make
KEEP Libpng 3a05dbc8218dced9bf7960ae06850ddd
BELONGS ya.make
-FILE_IGNORE include/png.h found in files: arm/arm_init.c at line 10, arm/filter_neon.S at line 10, arm/filter_neon_intrinsics.c at line 11, arm/palette_neon_intrinsics.c at line 10, intel/filter_sse2_intrinsics.c at line 11, intel/intel_init.c at line 11, mips/filter_msa_intrinsics.c at line 10, mips/mips_init.c at line 10, png.c at line 11, pngconf.h at line 13, pngdebug.h at line 11, pngerror.c at line 11, pngget.c at line 11, pnginfo.h at line 11, pngmem.c at line 11, pngpread.c at line 11, pngpriv.h at line 11, pngread.c at line 11, pngrio.c at line 11, pngrtran.c at line 11, pngrutil.c at line 11, pngset.c at line 11, pngstruct.h at line 11, pngtrans.c at line 11, pngwio.c at line 11, pngwrite.c at line 11, pngwtran.c at line 11, pngwutil.c at line 11, powerpc/filter_vsx_intrinsics.c at line 9, powerpc/powerpc_init.c at line 10
-FILE_IGNORE png.h found in files: arm/arm_init.c at line 10, arm/filter_neon.S at line 10, arm/filter_neon_intrinsics.c at line 11, arm/palette_neon_intrinsics.c at line 10, intel/filter_sse2_intrinsics.c at line 11, intel/intel_init.c at line 11, mips/filter_msa_intrinsics.c at line 10, mips/mips_init.c at line 10, png.c at line 11, pngconf.h at line 13, pngdebug.h at line 11, pngerror.c at line 11, pngget.c at line 11, pnginfo.h at line 11, pngmem.c at line 11, pngpread.c at line 11, pngpriv.h at line 11, pngread.c at line 11, pngrio.c at line 11, pngrtran.c at line 11, pngrutil.c at line 11, pngset.c at line 11, pngstruct.h at line 11, pngtrans.c at line 11, pngwio.c at line 11, pngwrite.c at line 11, pngwtran.c at line 11, pngwutil.c at line 11, powerpc/filter_vsx_intrinsics.c at line 9, powerpc/powerpc_init.c at line 10
+FILE_IGNORE include/png.h found in files: arm/arm_init.c at line 10, arm/filter_neon.S at line 8, arm/filter_neon_intrinsics.c at line 11, arm/palette_neon_intrinsics.c at line 10, intel/filter_sse2_intrinsics.c at line 11, intel/intel_init.c at line 11, mips/filter_mmi_inline_assembly.c at line 8, mips/filter_msa_intrinsics.c at line 10, mips/mips_init.c at line 11, png.c at line 11, pngconf.h at line 13, pngdebug.h at line 11, pngerror.c at line 11, pngget.c at line 11, pnginfo.h at line 11, pngmem.c at line 11, pngpread.c at line 11, pngpriv.h at line 11, pngread.c at line 11, pngrio.c at line 11, pngrtran.c at line 11, pngrutil.c at line 11, pngset.c at line 11, pngstruct.h at line 11, pngtrans.c at line 11, pngwio.c at line 11, pngwrite.c at line 11, pngwtran.c at line 11, pngwutil.c at line 11, powerpc/filter_vsx_intrinsics.c at line 9, powerpc/powerpc_init.c at line 10
+FILE_IGNORE png.h found in files: arm/arm_init.c at line 10, arm/filter_neon.S at line 8, arm/filter_neon_intrinsics.c at line 11, arm/palette_neon_intrinsics.c at line 10, intel/filter_sse2_intrinsics.c at line 11, intel/intel_init.c at line 11, mips/filter_mmi_inline_assembly.c at line 8, mips/filter_msa_intrinsics.c at line 10, mips/mips_init.c at line 11, png.c at line 11, pngconf.h at line 13, pngdebug.h at line 11, pngerror.c at line 11, pngget.c at line 11, pnginfo.h at line 11, pngmem.c at line 11, pngpread.c at line 11, pngpriv.h at line 11, pngread.c at line 11, pngrio.c at line 11, pngrtran.c at line 11, pngrutil.c at line 11, pngset.c at line 11, pngstruct.h at line 11, pngtrans.c at line 11, pngwio.c at line 11, pngwrite.c at line 11, pngwtran.c at line 11, pngwutil.c at line 11, powerpc/filter_vsx_intrinsics.c at line 9, powerpc/powerpc_init.c at line 10
License text:
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -133,13 +119,14 @@ FILE_IGNORE png.h found in files: arm/arm_init.c at line 10, arm/filter_neon.S a
Links : http://libpng.org/pub/png/src/libpng-LICENSE.txt, http://www.libpng.org/pub/png/libpng.html, https://spdx.org/licenses/Libpng
Files with this license:
arm/arm_init.c [8:10]
- arm/filter_neon.S [8:10]
+ arm/filter_neon.S [6:8]
arm/filter_neon_intrinsics.c [9:11]
arm/palette_neon_intrinsics.c [8:10]
intel/filter_sse2_intrinsics.c [9:11]
intel/intel_init.c [9:11]
+ mips/filter_mmi_inline_assembly.c [6:8]
mips/filter_msa_intrinsics.c [8:10]
- mips/mips_init.c [8:10]
+ mips/mips_init.c [9:11]
png.c [9:11]
pngconf.h [11:13]
pngdebug.h [9:11]
@@ -248,7 +235,7 @@ FILE_IGNORE png.h found in files: INSTALL at line 464
Files with this license:
INSTALL [462:464]
-KEEP libpng-2.0 7c3a35240ba33b0bb5f250afdd076b27
+KEEP libpng-2.0 7799c593fa0c34cd88d48e7a212af031
BELONGS ya.make
Note: matched license text is too long. Read it in the source files.
Scancode info:
@@ -298,6 +285,21 @@ BELONGS ya.make
Files with this license:
LICENSE [5:5]
+SKIP LicenseRef-scancode-free-unknown 95502569dcf2568eaa3effc6d65a8c30
+BELONGS ya.make
+ # Regards ci and contrib directories which we do not store
+ License text:
+ of the tools-generated files that are distributed with libpng, have
+ other copyright owners, and are released under other open source
+ licenses.
+ Scancode info:
+ Original SPDX id: LicenseRef-scancode-free-unknown
+ Score : 100.00
+ Match type : NOTICE
+ Links : https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/free-unknown.LICENSE
+ Files with this license:
+ AUTHORS [59:61]
+
KEEP Libpng a1fa29c834710a6f595de023fcd8738f
BELONGS ya.make
License text:
@@ -348,6 +350,18 @@ FILE_INCLUDE LICENSE found in files: README at line 111
Files with this license:
README [110:111]
+KEEP MIT c77269c6dd6f51bfbe84805b0c8a235f
+BELONGS ya.make
+ License text:
+ Relicensed the CI scripts to the MIT License.
+ Scancode info:
+ Original SPDX id: MIT
+ Score : 100.00
+ Match type : REFERENCE
+ Links : http://opensource.org/licenses/mit-license.php, https://spdx.org/licenses/MIT
+ Files with this license:
+ CHANGES [6160:6160]
+
KEEP Libpng c8298e366a3ed11e6a851c27f5f62556
BELONGS ya.make
License text:
@@ -358,7 +372,7 @@ BELONGS ya.make
Match type : NOTICE
Links : http://libpng.org/pub/png/src/libpng-LICENSE.txt, http://www.libpng.org/pub/png/libpng.html, https://spdx.org/licenses/Libpng
Files with this license:
- AUTHORS [48:48]
+ AUTHORS [56:56]
SKIP LicenseRef-scancode-free-unknown d21cb537845df6d3bd33063822351d5a
BELONGS ya.make
@@ -410,18 +424,6 @@ BELONGS ya.make
Files with this license:
png.h [73:94]
-KEEP libpng-2.0 d964429a132bf678731f5df030520bfb
-BELONGS ya.make
-FILE_INCLUDE LICENSE found in files: LICENSE at line 1
- Note: matched license text is too long. Read it in the source files.
- Scancode info:
- Original SPDX id: libpng-2.0
- Score : 95.76
- Match type : TEXT
- Links : http://www.libpng.org/pub/png/src/libpng-LICENSE.txt, https://spdx.org/licenses/libpng-2.0
- Files with this license:
- LICENSE [1:42]
-
KEEP Libpng e9bb4f8fbab91484ba62ccb1611b70bb
BELONGS ya.make
License text:
@@ -470,6 +472,18 @@ BELONGS ya.make
Files with this license:
LICENSE [64:71]
+KEEP libpng-2.0 fc1063e930ad717bd4ffddde10b75b8c
+BELONGS ya.make
+FILE_INCLUDE LICENSE found in files: LICENSE at line 1
+ Note: matched license text is too long. Read it in the source files.
+ Scancode info:
+ Original SPDX id: libpng-2.0
+ Score : 95.76
+ Match type : TEXT
+ Links : http://www.libpng.org/pub/png/src/libpng-LICENSE.txt, https://spdx.org/licenses/libpng-2.0
+ Files with this license:
+ LICENSE [1:42]
+
KEEP Libpng fc125ac8e86409d9543ae23600641ce9
BELONGS ya.make
License text:
diff --git a/contrib/libs/libpng/.yandex_meta/licenses.list.txt b/contrib/libs/libpng/.yandex_meta/licenses.list.txt
index 80ff5f75ee..1e6d12772b 100644
--- a/contrib/libs/libpng/.yandex_meta/licenses.list.txt
+++ b/contrib/libs/libpng/.yandex_meta/licenses.list.txt
@@ -1,6 +1,6 @@
====================COPYRIGHT====================
- * Copyright (c) 1995-2023 The PNG Reference Library Authors.
- * Copyright (c) 2018-2023 Cosmin Truta.
+ * Copyright (c) 1995-2024 The PNG Reference Library Authors.
+ * Copyright (c) 2018-2024 Cosmin Truta.
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* Copyright (c) 1996-1997 Andreas Dilger.
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -36,25 +36,6 @@
====================COPYRIGHT====================
* Copyright (c) 2018 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.
-
-
-====================COPYRIGHT====================
- * Copyright (c) 2018 Cosmin Truta
- * Copyright (c) 2014,2017 Glenn Randers-Pehrson
- * Written by Mans Rullgard, 2011.
-
-
-====================COPYRIGHT====================
- * Copyright (c) 2018 Cosmin Truta
- * Copyright (c) 2016 Glenn Randers-Pehrson
- * Written by Mandar Sahastrabuddhe, August 2016.
-
-
-====================COPYRIGHT====================
- * Copyright (c) 2018 Cosmin Truta
* Copyright (c) 2016-2017 Glenn Randers-Pehrson
* Written by Mike Klein and Matt Sarett
* Derived from arm/filter_neon_intrinsics.c
@@ -68,44 +49,61 @@
====================COPYRIGHT====================
* Copyright (c) 2018-2019 Cosmin Truta
+ * Copyright (c) 2017-2018 Arm Holdings. All rights reserved.
+
+
+====================COPYRIGHT====================
+ * Copyright (c) 2018-2022 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.
====================COPYRIGHT====================
- * Copyright (c) 2018-2019 Cosmin Truta
- * Copyright (c) 2017-2018 Arm Holdings. All rights reserved.
+ * Copyright (c) 2018-2022 Cosmin Truta
+ * Copyright (c) 2014,2016 Glenn Randers-Pehrson
+ * Written by Mans Rullgard, 2011.
====================COPYRIGHT====================
- * Copyright (c) 2018-2022 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
====================COPYRIGHT====================
- * Copyright (c) 2018-2022 Cosmin Truta
- * Copyright (c) 2014,2016 Glenn Randers-Pehrson
- * Written by Mans Rullgard, 2011.
+ * Copyright (c) 2018-2024 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.
====================COPYRIGHT====================
- * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
====================COPYRIGHT====================
- * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 1998-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
====================COPYRIGHT====================
+ * Copyright (c) 2018-2024 Cosmin Truta
+ * Copyright (c) 2016 Glenn Randers-Pehrson
+ * Written by Mandar Sahastrabuddhe, August 2016
+
+
+====================COPYRIGHT====================
+ * Copyright (c) 2024 Cosmin Truta
+
+
+====================COPYRIGHT====================
Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2024 Max Stepin,
and are delimited by "#ifdef PNG_APNG_SUPPORTED / #endif" directives
surrounding them in the modified libpng source files.
@@ -606,8 +604,8 @@ surrounding them in the modified libpng source files.
PNG Reference Library License version 2
---------------------------------------
- * Copyright (c) 1995-2023 The PNG Reference Library Authors.
- * Copyright (c) 2018-2023 Cosmin Truta.
+ * Copyright (c) 1995-2024 The PNG Reference Library Authors.
+ * Copyright (c) 2018-2024 Cosmin Truta.
* Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* Copyright (c) 1996-1997 Andreas Dilger.
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -1014,9 +1012,13 @@ other copyright owners, but are released under the libpng license.
released under the libpng license described below. The modifications are
+====================MIT====================
+ Relicensed the CI scripts to the MIT License.
+
+
====================libpng-2.0====================
- * * Copyright (c) 1995-2023 The PNG Reference Library Authors.
- * * Copyright (c) 2018-2023 Cosmin Truta.
+ * * Copyright (c) 1995-2024 The PNG Reference Library Authors.
+ * * Copyright (c) 2018-2024 Cosmin Truta.
* * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* * Copyright (c) 1996-1997 Andreas Dilger.
* * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -1060,8 +1062,8 @@ surrounding them in the modified libpng source files.
PNG Reference Library License version 2
---------------------------------------
- * Copyright (c) 1995-2023 The PNG Reference Library Authors.
- * Copyright (c) 2018-2023 Cosmin Truta.
+ * Copyright (c) 1995-2024 The PNG Reference Library Authors.
+ * Copyright (c) 2018-2024 Cosmin Truta.
* Copyright (c) 2000-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/contrib/libs/libpng/.yandex_meta/override.nix b/contrib/libs/libpng/.yandex_meta/override.nix
index 23f741e884..c3ac881494 100644
--- a/contrib/libs/libpng/.yandex_meta/override.nix
+++ b/contrib/libs/libpng/.yandex_meta/override.nix
@@ -1,11 +1,11 @@
pkgs: attrs: with pkgs; rec {
- version = "1.6.40";
+ version = "1.6.44";
src = fetchFromGitHub {
owner = "pnggroup";
repo = "libpng";
rev = "v${version}";
- hash = "sha256-Rad7Y5Z9PUCipBTQcB7LEP8fIVTG3JsnMeknUkZ/rRg=";
+ hash = "sha256-gBfHgGaqVYdmhWXoNKZzPyGzyw2rr3zp+DjWmfC41jk=";
};
# nixpkgs applies apng patch from sourceforge.net, which changes for every libpng version.
diff --git a/contrib/libs/libpng/ANNOUNCE b/contrib/libs/libpng/ANNOUNCE
index 404cbb0de9..a2a7ac363a 100644
--- a/contrib/libs/libpng/ANNOUNCE
+++ b/contrib/libs/libpng/ANNOUNCE
@@ -1,5 +1,5 @@
-libpng 1.6.40 - June 21, 2023
-=============================
+libpng 1.6.44 - September 12, 2024
+==================================
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.40.tar.xz (LZMA-compressed, recommended)
- * libpng-1.6.40.tar.gz
+ * libpng-1.6.44.tar.xz (LZMA-compressed, recommended)
+ * libpng-1.6.44.tar.gz (deflate-compressed)
Source files with CRLF line endings (for Windows):
- * lpng1640.7z (LZMA-compressed, recommended)
- * lpng1640.zip
+ * lpng1644.7z (LZMA-compressed, recommended)
+ * lpng1644.zip (deflate-compressed)
Other information:
@@ -25,15 +25,29 @@ Other information:
* TRADEMARK.md
-Changes from version 1.6.39 to version 1.6.40
+Changes from version 1.6.43 to version 1.6.44
---------------------------------------------
- * Fixed the eXIf chunk multiplicity checks.
- * Fixed a memory leak in pCAL processing.
- * Corrected the validity report about tRNS inside png_get_valid().
- * Fixed various build issues on *BSD, Mac and Windows.
- * Updated the configurations and the scripts for continuous integration.
- * Cleaned up the code, the build scripts, and the documentation.
+ * Hardened calculations in chroma handling to prevent overflows, and
+ relaxed a constraint in cHRM validation to accomodate the standard
+ ACES AP1 set of color primaries.
+ (Contributed by John Bowler)
+ * Removed the ASM implementation of ARM Neon optimizations and updated
+ the build accordingly. Only the remaining C implementation shall be
+ used from now on, thus ensuring the support of the PAC/BTI security
+ features on ARM64.
+ (Contributed by Ross Burton and John Bowler)
+ * Fixed the pickup of the PNG_HARDWARE_OPTIMIZATIONS option in the
+ CMake build on FreeBSD/amd64. This is an important performance fix
+ on this platform.
+ * Applied various fixes and improvements to the CMake build.
+ (Contributed by Eric Riff, Benjamin Buch and Erik Scholz)
+ * Added fuzzing targets for the simplified read API.
+ (Contributed by Mikhail Khachayants)
+ * Fixed a build error involving pngtest.c under a custom config.
+ This was a regression introduced in a code cleanup in libpng-1.6.43.
+ (Contributed by Ben Wagner)
+ * Fixed and improved the config files for AppVeyor CI and Travis CI.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
diff --git a/contrib/libs/libpng/AUTHORS b/contrib/libs/libpng/AUTHORS
index 60f41e5c65..544341694a 100644
--- a/contrib/libs/libpng/AUTHORS
+++ b/contrib/libs/libpng/AUTHORS
@@ -4,7 +4,9 @@ PNG REFERENCE LIBRARY AUTHORS
This is the list of PNG Reference Library ("libpng") Contributing
Authors, for copyright and licensing purposes.
+ * Adam Richter
* Andreas Dilger
+ * Chris Blume
* Cosmin Truta
* Dave Martindale
* Eric S. Raymond
@@ -33,20 +35,27 @@ Authors, for copyright and licensing purposes.
* Vadim Barkov
* Willem van Schaik
* Zhijie Liang
+ * Apple Inc.
+ - Zixu Wang (王子旭)
* Arm Holdings
- - Richard Townsend
+ - Richard Townsend
* Google Inc.
- - Dan Field
- - Leon Scroggins III
- - Matt Sarett
- - Mike Klein
- - Sami Boukortt
- - Wan-Teh Chang
+ - Dan Field
+ - Leon Scroggins III
+ - Matt Sarett
+ - Mike Klein
+ - Sami Boukortt
+ - Wan-Teh Chang
+ * Loongson Technology Corporation Ltd.
+ - GuXiWei (顾希伟)
+ - JinBo (金波)
+ - ZhangLixia (张利霞)
The build projects, the build scripts, the test scripts, and other
-files in the "ci", "projects", "scripts" and "tests" directories, have
+files in the "projects", "scripts" and "tests" directories, have
other copyright owners, but are released under the libpng license.
-Some files in the "contrib" directory, and some tools-generated files
-that are distributed with libpng, have other copyright owners, and are
-released under other open source licenses.
+Some files in the "ci" and "contrib" directories, as well as some
+of the tools-generated files that are distributed with libpng, have
+other copyright owners, and are released under other open source
+licenses.
diff --git a/contrib/libs/libpng/CHANGES b/contrib/libs/libpng/CHANGES
index 2d8c585c0e..724ccca2d6 100644
--- a/contrib/libs/libpng/CHANGES
+++ b/contrib/libs/libpng/CHANGES
@@ -6129,6 +6129,95 @@ Version 1.6.40 [June 21, 2023]
Updated the configurations and the scripts for continuous integration.
Cleaned up the code, the build scripts, and the documentation.
+Version 1.6.41 [January 24, 2024]
+ Added SIMD-optimized code for the LoongArch LSX hardware.
+ (Contributed by GuXiWei, JinBo and ZhangLixia)
+ Fixed the run-time discovery of MIPS MSA hardware.
+ (Contributed by Sui Jingfeng)
+ Fixed an off-by-one error in the function png_do_check_palette_indexes(),
+ which failed to recognize errors that might have existed in the first
+ column of a broken palette-encoded image. This was a benign regression
+ accidentally introduced in libpng-1.6.33. No pixel was harmed.
+ (Contributed by Adam Richter; reviewed by John Bowler)
+ Fixed, improved and modernized the contrib/pngminus programs, i.e.,
+ png2pnm.c and pnm2png.c
+ Removed old and peculiar portability hacks that were meant to silence
+ warnings issued by gcc version 7.1 alone.
+ (Contributed by John Bowler)
+ Fixed and modernized the CMake file, and raised the minimum required
+ CMake version from 3.1 to 3.6.
+ (Contributed by Clinton Ingram, Timothy Lyanguzov, Tyler Kropp, et al.)
+ Allowed the configure script to disable the building of auxiliary tools
+ and tests, thus catching up with the CMake file.
+ (Contributed by Carlo Bramini)
+ Fixed a build issue on Mac.
+ (Contributed by Zixu Wang)
+ Moved the Autoconf macro files to scripts/autoconf.
+ Moved the CMake files (except for the main CMakeLists.txt) to
+ scripts/cmake and moved the list of their contributing authors to
+ scripts/cmake/AUTHORS.md
+ Updated the CI configurations and scripts.
+ Relicensed the CI scripts to the MIT License.
+ Improved the test coverage.
+ (Contributed by John Bowler)
+
+Version 1.6.42 [January 29, 2024]
+ Fixed the implementation of the macro function png_check_sig().
+ This was an API regression, introduced in libpng-1.6.41.
+ (Reported by Matthieu Darbois)
+ Fixed and updated the libpng manual.
+
+Version 1.6.43 [February 23, 2024]
+ Fixed the row width check in png_check_IHDR().
+ This corrected a bug that was specific to the 16-bit platforms,
+ and removed a spurious compiler warning from the 64-bit builds.
+ (Reported by Jacek Caban; fixed by John Bowler)
+ Added eXIf chunk support to the push-mode reader in pngpread.c.
+ (Contributed by Chris Blume)
+ Added contrib/pngexif for the benefit of the users who would like
+ to inspect the content of eXIf chunks.
+ Added contrib/conftest/basic.dfa, a basic build-time configuration.
+ (Contributed by John Bowler)
+ Fixed a preprocessor condition in pngread.c that broke build-time
+ configurations like contrib/conftest/pngcp.dfa.
+ (Contributed by John Bowler)
+ Added CMake build support for LoongArch LSX.
+ (Contributed by GuXiWei)
+ Fixed a CMake build error that occurred under a peculiar state of the
+ dependency tree. This was a regression introduced in libpng-1.6.41.
+ (Contributed by Dan Rosser)
+ Marked the installed libpng headers as system headers in CMake.
+ (Contributed by Benjamin Buch)
+ Updated the build support for RISCOS.
+ (Contributed by Cameron Cawley)
+ Updated the makefiles to allow cross-platform builds to initialize
+ conventional make variables like AR and ARFLAGS.
+ Added various improvements to the CI scripts in areas like version
+ consistency verification and text linting.
+ Added version consistency verification to pngtest.c also.
+
+Version 1.6.44 [September 12, 2024]
+ Hardened calculations in chroma handling to prevent overflows, and
+ relaxed a constraint in cHRM validation to accomodate the standard
+ ACES AP1 set of color primaries.
+ (Contributed by John Bowler)
+ Removed the ASM implementation of ARM Neon optimizations and updated
+ the build accordingly. Only the remaining C implementation shall be
+ used from now on, thus ensuring the support of the PAC/BTI security
+ features on ARM64.
+ (Contributed by Ross Burton and John Bowler)
+ Fixed the pickup of the PNG_HARDWARE_OPTIMIZATIONS option in the
+ CMake build on FreeBSD/amd64. This is an important performance fix
+ on this platform.
+ Applied various fixes and improvements to the CMake build.
+ (Contributed by Eric Riff, Benjamin Buch and Erik Scholz)
+ Added fuzzing targets for the simplified read API.
+ (Contributed by Mikhail Khachayants)
+ Fixed a build error involving pngtest.c under a custom config.
+ This was a regression introduced in a code cleanup in libpng-1.6.43.
+ (Contributed by Ben Wagner)
+ Fixed and improved the config files for AppVeyor CI and Travis CI.
+
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/contrib/libs/libpng/LICENSE b/contrib/libs/libpng/LICENSE
index 10033488bd..1ea1f8b85f 100644
--- a/contrib/libs/libpng/LICENSE
+++ b/contrib/libs/libpng/LICENSE
@@ -10,8 +10,8 @@ surrounding them in the modified libpng source files.
PNG Reference Library License version 2
---------------------------------------
- * Copyright (c) 1995-2023 The PNG Reference Library Authors.
- * Copyright (c) 2018-2023 Cosmin Truta.
+ * Copyright (c) 1995-2024 The PNG Reference Library Authors.
+ * Copyright (c) 2018-2024 Cosmin Truta.
* Copyright (c) 2000-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/contrib/libs/libpng/README b/contrib/libs/libpng/README
index dedd2c1639..3af606889b 100644
--- a/contrib/libs/libpng/README
+++ b/contrib/libs/libpng/README
@@ -1,4 +1,4 @@
-README for libpng version 1.6.40
+README for libpng version 1.6.44
================================
See the note about version numbers near the top of `png.h`.
@@ -142,10 +142,11 @@ Files included in this distribution
pngwrite.c => High-level write functions
pngwtran.c => Write data transformations
pngwutil.c => Write utility functions
- arm/ => Optimized code for the ARM platform
- intel/ => Optimized code for the INTEL-SSE2 platform
- mips/ => Optimized code for the MIPS platform
- powerpc/ => Optimized code for the PowerPC platform
+ arm/ => Optimized code for ARM Neon
+ intel/ => Optimized code for INTEL SSE2
+ loongarch/ => Optimized code for LoongArch LSX
+ mips/ => Optimized code for MIPS MSA and MIPS MMI
+ powerpc/ => Optimized code for PowerPC VSX
ci/ => Scripts for continuous integration
contrib/ => External contributions
arm-neon/ => Optimized code for the ARM-NEON platform
@@ -158,6 +159,7 @@ Files included in this distribution
libtests/ => Test programs
oss-fuzz/ => Files used by the OSS-Fuzz project for fuzz-testing
libpng
+ pngexif/ => Program to inspect the EXIF information in PNG files
pngminim/ => Minimal decoder, encoder, and progressive decoder
programs demonstrating the use of pngusr.dfa
pngminus/ => Simple pnm2png and png2pnm programs
diff --git a/contrib/libs/libpng/arm/filter_neon.S b/contrib/libs/libpng/arm/filter_neon.S
index 2308aad13e..fc3c7a2964 100644
--- a/contrib/libs/libpng/arm/filter_neon.S
+++ b/contrib/libs/libpng/arm/filter_neon.S
@@ -1,253 +1,61 @@
-/* filter_neon.S - NEON optimised filter functions
+/* filter_neon.S - placeholder file
*
- * Copyright (c) 2018 Cosmin Truta
- * Copyright (c) 2014,2017 Glenn Randers-Pehrson
- * Written by Mans Rullgard, 2011.
+ * Copyright (c) 2024 Cosmin Truta
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
+/* IMPORTANT NOTE:
+ *
+ * Historically, the hand-coded assembler implementation of Neon optimizations
+ * in this module had not been in sync with the intrinsics-based implementation
+ * in filter_neon_intrinsics.c and palette_neon_intrinsics.c, at least since
+ * the introduction of riffled palette optimizations. Moreover, the assembler
+ * code used to work on 32-bit ARM only, and it caused problems, even if empty,
+ * on 64-bit ARM.
+ *
+ * All references to this module from our internal build scripts and projects
+ * have been removed.
+ *
+ * For the external projects that might still expect this module to be present,
+ * we leave this stub in place, for the remaining lifetime of libpng-1.6.x.
+ * Everything should continue to function normally, as long as there are no
+ * deliberate attempts to use the old hand-made assembler code. A build error
+ * will be raised otherwise.
+ */
+
/* This is required to get the symbol renames, which are #defines, and the
* definitions (or not) of PNG_ARM_NEON_OPT and PNG_ARM_NEON_IMPLEMENTATION.
*/
#define PNG_VERSION_INFO_ONLY
#include "../pngpriv.h"
-#if (defined(__linux__) || defined(__FreeBSD__)) && defined(__ELF__)
-.section .note.GNU-stack,"",%progbits /* mark stack as non-executable */
-#endif
-
#ifdef PNG_READ_SUPPORTED
-
-/* Assembler NEON support - only works for 32-bit ARM (i.e. it does not work for
- * ARM64). The code in arm/filter_neon_intrinsics.c supports ARM64, however it
- * only works if -mfpu=neon is specified on the GCC command line. See pngpriv.h
- * for the logic which sets PNG_USE_ARM_NEON_ASM:
- */
#if PNG_ARM_NEON_IMPLEMENTATION == 2 /* hand-coded assembler */
-
#if PNG_ARM_NEON_OPT > 0
-#ifdef __ELF__
-# define ELF
+#if defined(__clang__)
+#define GNUC_VERSION 0 /* not gcc, although it might pretend to be */
+#elif defined(__GNUC__)
+#define GNUC_MAJOR (__GNUC__ + 0)
+#define GNUC_MINOR (__GNUC_MINOR__ + 0)
+#define GNUC_PATCHLEVEL (__GNUC_PATCHLEVEL__ + 0)
+#define GNUC_VERSION (GNUC_MAJOR * 10000 + GNUC_MINOR * 100 + GNUC_PATCHLEVEL)
#else
-# define ELF @
+#define GNUC_VERSION 0 /* not gcc */
#endif
- .arch armv7-a
- .fpu neon
-
-.macro func name, export=0
- .macro endfunc
-ELF .size \name, . - \name
- .endfunc
- .purgem endfunc
- .endm
- .text
-
- /* Explicitly specifying alignment here because some versions of
- * GAS don't align code correctly. This is harmless in correctly
- * written versions of GAS.
- */
- .align 2
-
- .if \export
- .global \name
- .endif
-ELF .type \name, STT_FUNC
- .func \name
-\name:
-.endm
-
-func png_read_filter_row_sub4_neon, export=1
- ldr r3, [r0, #4] @ rowbytes
- vmov.i8 d3, #0
-1:
- vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
- vadd.u8 d0, d3, d4
- vadd.u8 d1, d0, d5
- vadd.u8 d2, d1, d6
- vadd.u8 d3, d2, d7
- vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
- subs r3, r3, #16
- bgt 1b
-
- bx lr
-endfunc
-
-func png_read_filter_row_sub3_neon, export=1
- ldr r3, [r0, #4] @ rowbytes
- vmov.i8 d3, #0
- mov r0, r1
- mov r2, #3
- mov r12, #12
- vld1.8 {q11}, [r0], r12
-1:
- vext.8 d5, d22, d23, #3
- vadd.u8 d0, d3, d22
- vext.8 d6, d22, d23, #6
- vadd.u8 d1, d0, d5
- vext.8 d7, d23, d23, #1
- vld1.8 {q11}, [r0], r12
- vst1.32 {d0[0]}, [r1,:32], r2
- vadd.u8 d2, d1, d6
- vst1.32 {d1[0]}, [r1], r2
- vadd.u8 d3, d2, d7
- vst1.32 {d2[0]}, [r1], r2
- vst1.32 {d3[0]}, [r1], r2
- subs r3, r3, #12
- bgt 1b
-
- bx lr
-endfunc
-
-func png_read_filter_row_up_neon, export=1
- ldr r3, [r0, #4] @ rowbytes
-1:
- vld1.8 {q0}, [r1,:128]
- vld1.8 {q1}, [r2,:128]!
- vadd.u8 q0, q0, q1
- vst1.8 {q0}, [r1,:128]!
- subs r3, r3, #16
- bgt 1b
-
- bx lr
-endfunc
-
-func png_read_filter_row_avg4_neon, export=1
- ldr r12, [r0, #4] @ rowbytes
- vmov.i8 d3, #0
-1:
- vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
- vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]!
- vhadd.u8 d0, d3, d16
- vadd.u8 d0, d0, d4
- vhadd.u8 d1, d0, d17
- vadd.u8 d1, d1, d5
- vhadd.u8 d2, d1, d18
- vadd.u8 d2, d2, d6
- vhadd.u8 d3, d2, d19
- vadd.u8 d3, d3, d7
- vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
- subs r12, r12, #16
- bgt 1b
-
- bx lr
-endfunc
-
-func png_read_filter_row_avg3_neon, export=1
- push {r4,lr}
- ldr r12, [r0, #4] @ rowbytes
- vmov.i8 d3, #0
- mov r0, r1
- mov r4, #3
- mov lr, #12
- vld1.8 {q11}, [r0], lr
-1:
- vld1.8 {q10}, [r2], lr
- vext.8 d5, d22, d23, #3
- vhadd.u8 d0, d3, d20
- vext.8 d17, d20, d21, #3
- vadd.u8 d0, d0, d22
- vext.8 d6, d22, d23, #6
- vhadd.u8 d1, d0, d17
- vext.8 d18, d20, d21, #6
- vadd.u8 d1, d1, d5
- vext.8 d7, d23, d23, #1
- vld1.8 {q11}, [r0], lr
- vst1.32 {d0[0]}, [r1,:32], r4
- vhadd.u8 d2, d1, d18
- vst1.32 {d1[0]}, [r1], r4
- vext.8 d19, d21, d21, #1
- vadd.u8 d2, d2, d6
- vhadd.u8 d3, d2, d19
- vst1.32 {d2[0]}, [r1], r4
- vadd.u8 d3, d3, d7
- vst1.32 {d3[0]}, [r1], r4
- subs r12, r12, #12
- bgt 1b
-
- pop {r4,pc}
-endfunc
-
-.macro paeth rx, ra, rb, rc
- vaddl.u8 q12, \ra, \rb @ a + b
- vaddl.u8 q15, \rc, \rc @ 2*c
- vabdl.u8 q13, \rb, \rc @ pa
- vabdl.u8 q14, \ra, \rc @ pb
- vabd.u16 q15, q12, q15 @ pc
- vcle.u16 q12, q13, q14 @ pa <= pb
- vcle.u16 q13, q13, q15 @ pa <= pc
- vcle.u16 q14, q14, q15 @ pb <= pc
- vand q12, q12, q13 @ pa <= pb && pa <= pc
- vmovn.u16 d28, q14
- vmovn.u16 \rx, q12
- vbsl d28, \rb, \rc
- vbsl \rx, \ra, d28
-.endm
-
-func png_read_filter_row_paeth4_neon, export=1
- ldr r12, [r0, #4] @ rowbytes
- vmov.i8 d3, #0
- vmov.i8 d20, #0
-1:
- vld4.32 {d4[],d5[],d6[],d7[]}, [r1,:128]
- vld4.32 {d16[],d17[],d18[],d19[]},[r2,:128]!
- paeth d0, d3, d16, d20
- vadd.u8 d0, d0, d4
- paeth d1, d0, d17, d16
- vadd.u8 d1, d1, d5
- paeth d2, d1, d18, d17
- vadd.u8 d2, d2, d6
- paeth d3, d2, d19, d18
- vmov d20, d19
- vadd.u8 d3, d3, d7
- vst4.32 {d0[0],d1[0],d2[0],d3[0]},[r1,:128]!
- subs r12, r12, #16
- bgt 1b
-
- bx lr
-endfunc
-
-func png_read_filter_row_paeth3_neon, export=1
- push {r4,lr}
- ldr r12, [r0, #4] @ rowbytes
- vmov.i8 d3, #0
- vmov.i8 d4, #0
- mov r0, r1
- mov r4, #3
- mov lr, #12
- vld1.8 {q11}, [r0], lr
-1:
- vld1.8 {q10}, [r2], lr
- paeth d0, d3, d20, d4
- vext.8 d5, d22, d23, #3
- vadd.u8 d0, d0, d22
- vext.8 d17, d20, d21, #3
- paeth d1, d0, d17, d20
- vst1.32 {d0[0]}, [r1,:32], r4
- vext.8 d6, d22, d23, #6
- vadd.u8 d1, d1, d5
- vext.8 d18, d20, d21, #6
- paeth d2, d1, d18, d17
- vext.8 d7, d23, d23, #1
- vld1.8 {q11}, [r0], lr
- vst1.32 {d1[0]}, [r1], r4
- vadd.u8 d2, d2, d6
- vext.8 d19, d21, d21, #1
- paeth d3, d2, d19, d18
- vst1.32 {d2[0]}, [r1], r4
- vmov d4, d19
- vadd.u8 d3, d3, d7
- vst1.32 {d3[0]}, [r1], r4
- subs r12, r12, #12
- bgt 1b
+#if (GNUC_VERSION > 0) && (GNUC_VERSION < 40300)
+#error "PNG_ARM_NEON is not supported with gcc versions earlier than 4.3.0"
+#elif GNUC_VERSION == 40504
+#error "PNG_ARM_NEON is not supported with gcc version 4.5.4"
+#else
+#error "Please use 'arm/*_neon_intrinsics.c' for PNG_ARM_NEON support"
+#endif
- pop {r4,pc}
-endfunc
#endif /* PNG_ARM_NEON_OPT > 0 */
-#endif /* PNG_ARM_NEON_IMPLEMENTATION == 2 (assembler) */
+#endif /* PNG_ARM_NEON_IMPLEMENTATION == 2 */
#endif /* READ */
diff --git a/contrib/libs/libpng/mips/filter_mmi_inline_assembly.c b/contrib/libs/libpng/mips/filter_mmi_inline_assembly.c
new file mode 100644
index 0000000000..b330a46538
--- /dev/null
+++ b/contrib/libs/libpng/mips/filter_mmi_inline_assembly.c
@@ -0,0 +1,525 @@
+/* filter_mmi_intrinsics.c - MMI optimized filter functions
+ *
+ * Copyright (c) 2024 Cosmin Truta
+ * Written by zhanglixia and guxiwei, 2023
+ *
+ * This code is released under the libpng license.
+ * For conditions of distribution and use, see the disclaimer
+ * and license in png.h
+ */
+
+#include "../pngpriv.h"
+
+#ifdef PNG_READ_SUPPORTED
+
+#if PNG_MIPS_MMI_IMPLEMENTATION == 2 /* Inline Assembly */
+
+/* Functions in this file look at most 3 pixels (a,b,c) to predict the 4th (d).
+ * They're positioned like this:
+ * prev: c b
+ * row: a d
+ * The Sub filter predicts d=a, Avg d=(a+b)/2, and Paeth predicts d to be
+ * whichever of a, b, or c is closest to p=a+b-c.
+ */
+
+void png_read_filter_row_up_mmi(png_row_infop row_info, png_bytep row,
+ png_const_bytep prev_row)
+{
+ int istop = row_info->rowbytes;
+ double rp,pp;
+ __asm__ volatile (
+ "1: \n\t"
+ "ldc1 %[rp], 0x00(%[row]) \n\t"
+ "ldc1 %[pp], 0x00(%[prev_row]) \n\t"
+ "paddb %[rp], %[rp], %[pp] \n\t"
+ "sdc1 %[rp], 0x00(%[row]) \n\t"
+
+ "daddiu %[row], %[row], 0x08 \n\t"
+ "daddiu %[prev_row], %[prev_row], 0x08 \n\t"
+ "daddiu %[istop], %[istop], -0x08 \n\t"
+ "bgtz %[istop], 1b \n\t"
+ : [rp]"=&f"(rp), [pp]"=&f"(pp)
+ : [row]"r"(row), [prev_row]"r"(prev_row),
+ [istop]"r"(istop)
+ : "memory"
+ );
+}
+
+void png_read_filter_row_sub3_mmi(png_row_infop row_info, png_bytep row,
+ png_const_bytep prev)
+{
+ int istop = row_info->rowbytes;
+ double rp, pp, dest;
+ double eight, sixteen, twenty_four, forty_eight;
+ double tmp0;
+ double ftmp[2];
+
+ __asm__ volatile (
+ "li %[tmp0], 0x08 \n\t"
+ "dmtc1 %[tmp0], %[eight] \n\t"
+ "li %[tmp0], 0x10 \n\t"
+ "dmtc1 %[tmp0], %[sixteen] \n\t"
+ "li %[tmp0], 0x18 \n\t"
+ "dmtc1 %[tmp0], %[twenty_four] \n\t"
+ "li %[tmp0], 0x30 \n\t"
+ "dmtc1 %[tmp0], %[forty_eight] \n\t"
+ "xor %[dest], %[dest], %[dest] \n\t"
+
+ "1: \n\t"
+ "gsldrc1 %[rp], 0x00(%[row]) \n\t"
+ "gsldlc1 %[rp], 0x07(%[row]) \n\t"
+ "gsldrc1 %[pp], 0x08(%[row]) \n\t"
+ "gsldlc1 %[pp], 0x0f(%[row]) \n\t"
+
+ "paddb %[ftmp0], %[dest], %[rp] \n\t"
+ "swc1 %[ftmp0], 0x00(%[row]) \n\t"
+
+ "dsrl %[ftmp1], %[rp], %[twenty_four] \n\t"
+ "paddb %[dest], %[ftmp1], %[ftmp0] \n\t"
+ "gsswrc1 %[dest], 0x03(%[row]) \n\t"
+ "gsswlc1 %[dest], 0x06(%[row]) \n\t"
+
+ "dsrl %[ftmp0], %[rp], %[forty_eight] \n\t"
+ "dsll %[ftmp1], %[pp], %[sixteen] \n\t"
+ "or %[ftmp0], %[ftmp0], %[ftmp1] \n\t"
+ "paddb %[dest], %[dest], %[ftmp0] \n\t"
+ "gsswrc1 %[dest], 0x06(%[row]) \n\t"
+ "gsswlc1 %[dest], 0x09(%[row]) \n\t"
+
+ "dsrl %[ftmp0], %[pp], %[eight] \n\t"
+ "paddb %[dest], %[dest], %[ftmp0] \n\t"
+ "gsswrc1 %[dest], 0x09(%[row]) \n\t"
+ "daddiu %[row], %[row], 0x0c \n\t"
+ "daddiu %[istop], %[istop], -0x0c \n\t"
+ "bgtz %[istop], 1b \n\t"
+ : [rp]"=&f"(rp), [pp]"=&f"(pp), [dest]"=&f"(dest),
+ [tmp0]"=&r"(tmp0), [ftmp0]"=&f"(ftmp[0]),
+ [ftmp1]"=&f"(ftmp[1]), [eight]"=&f"(eight),
+ [sixteen]"=&f"(sixteen), [twenty_four]"=&f"(twenty_four),
+ [forty_eight]"=&f"(forty_eight)
+ : [row]"r"(row), [istop]"r"(istop)
+ : "memory"
+ );
+
+ PNG_UNUSED(prev)
+}
+
+void png_read_filter_row_sub4_mmi(png_row_infop row_info, png_bytep row,
+ png_const_bytep prev)
+{
+ /* The Sub filter predicts each pixel as the previous pixel, a.
+ * There is no pixel to the left of the first pixel. It's encoded directly.
+ * That works with our main loop if we just say that left pixel was zero.
+ */
+ int istop = row_info->rowbytes;
+ double rp,pp;
+
+ __asm__ volatile (
+ "1: \n\t"
+ "lwc1 %[pp], 0x00(%[row]) \n\t"
+ "lwc1 %[rp], 0x04(%[row]) \n\t"
+ "paddb %[rp], %[rp], %[pp] \n\t"
+ "swc1 %[rp], 0x04(%[row]) \n\t"
+
+ "daddiu %[row], %[row], 0x04 \n\t"
+ "daddiu %[istop], %[istop], -0x04 \n\t"
+ "bgtz %[istop], 1b \n\t"
+ : [rp]"=&f"(rp), [pp]"=&f"(pp)
+ : [row]"r"(row), [istop]"r"(istop)
+ : "memory"
+ );
+
+ PNG_UNUSED(prev)
+}
+
+void png_read_filter_row_avg3_mmi(png_row_infop row_info, png_bytep row,
+ png_const_bytep prev)
+{
+ int istop = row_info->rowbytes;
+ double rp, pp, rp1, pp1;
+ double tmp0;
+ double ftmp[3];
+ double one, dest;
+ double eight, sixteen, twenty_four, forty_eight;
+
+ __asm__ volatile (
+ "li %[tmp0], 0x08 \n\t"
+ "dmtc1 %[tmp0], %[eight] \n\t"
+ "li %[tmp0], 0x10 \n\t"
+ "dmtc1 %[tmp0], %[sixteen] \n\t"
+ "li %[tmp0], 0x18 \n\t"
+ "dmtc1 %[tmp0], %[twenty_four] \n\t"
+ "li %[tmp0], 0x30 \n\t"
+ "dmtc1 %[tmp0], %[forty_eight] \n\t"
+ "xor %[dest], %[dest], %[dest] \n\t"
+
+ "li %[tmp0], 0x01 \n\t"
+ "ins %[tmp0], %[tmp0], 8, 8 \n\t"
+ "dmtc1 %[tmp0], %[one] \n\t"
+ "pshufh %[one], %[one], %[dest] \n\t"
+
+ "1: \n\t"
+ "gsldrc1 %[rp], 0x00(%[row]) \n\t"
+ "gsldlc1 %[rp], 0x07(%[row]) \n\t"
+ "gsldrc1 %[pp], 0x00(%[prev]) \n\t"
+ "gsldlc1 %[pp], 0x07(%[prev]) \n\t"
+ "gsldrc1 %[rp1], 0x08(%[row]) \n\t"
+ "gsldlc1 %[rp1], 0x0f(%[row]) \n\t"
+ "gsldrc1 %[pp1], 0x08(%[prev]) \n\t"
+ "gsldlc1 %[pp1], 0x0f(%[prev]) \n\t"
+
+ "xor %[ftmp0], %[pp], %[dest] \n\t"
+ "pavgb %[ftmp1], %[pp], %[dest] \n\t"
+ "and %[ftmp0], %[ftmp0], %[one] \n\t"
+ "psubb %[ftmp1], %[ftmp1], %[ftmp0] \n\t"
+ "paddb %[dest], %[rp], %[ftmp1] \n\t"
+ "swc1 %[dest], 0x00(%[row]) \n\t"
+
+ "dsrl %[ftmp0], %[rp], %[twenty_four] \n\t"
+ "dsrl %[ftmp1], %[pp], %[twenty_four] \n\t"
+
+ "xor %[ftmp2], %[ftmp1], %[dest] \n\t"
+ "pavgb %[ftmp1], %[ftmp1], %[dest] \n\t"
+ "and %[ftmp2], %[ftmp2], %[one] \n\t"
+ "psubb %[ftmp1], %[ftmp1], %[ftmp2] \n\t"
+ "paddb %[dest], %[ftmp0], %[ftmp1] \n\t"
+ "gsswrc1 %[dest], 0x03(%[row]) \n\t"
+ "gsswlc1 %[dest], 0x06(%[row]) \n\t"
+
+ "dsrl %[ftmp0], %[rp], %[forty_eight] \n\t"
+ "dsll %[ftmp1], %[rp1], %[sixteen] \n\t"
+ "or %[ftmp0], %[ftmp0], %[ftmp1] \n\t"
+ "dsrl %[ftmp2], %[pp], %[forty_eight] \n\t"
+ "dsll %[ftmp1], %[pp1], %[sixteen] \n\t"
+ "or %[ftmp1], %[ftmp2], %[ftmp1] \n\t"
+
+ "xor %[ftmp2], %[ftmp1], %[dest] \n\t"
+ "pavgb %[ftmp1], %[ftmp1], %[dest] \n\t"
+ "and %[ftmp2], %[ftmp2], %[one] \n\t"
+ "psubb %[ftmp1], %[ftmp1], %[ftmp2] \n\t"
+ "paddb %[dest], %[ftmp0], %[ftmp1] \n\t"
+ "gsswrc1 %[dest], 0x06(%[row]) \n\t"
+ "gsswlc1 %[dest], 0x09(%[row]) \n\t"
+
+ "dsrl %[ftmp0], %[rp1], %[eight] \n\t"
+ "dsrl %[ftmp1], %[pp1], %[eight] \n\t"
+
+ "xor %[ftmp2], %[ftmp1], %[dest] \n\t"
+ "pavgb %[ftmp1], %[ftmp1], %[dest] \n\t"
+ "and %[ftmp2], %[ftmp2], %[one] \n\t"
+ "psubb %[ftmp1], %[ftmp1], %[ftmp2] \n\t"
+ "paddb %[dest], %[ftmp0], %[ftmp1] \n\t"
+ "gsswrc1 %[dest], 0x09(%[row]) \n\t"
+ "daddiu %[row], %[row], 0x0c \n\t"
+ "daddiu %[prev], %[prev], 0x0c \n\t"
+ "daddiu %[istop], %[istop], -0x0c \n\t"
+ "bgtz %[istop], 1b \n\t"
+ : [rp]"=&f"(rp), [pp]"=&f"(pp), [rp1]"=&f"(rp1),
+ [pp1]"=&f"(pp1), [tmp0]"=&r"(tmp0), [ftmp0]"=&f"(ftmp[0]),
+ [ftmp1]"=&f"(ftmp[1]), [ftmp2]"=&f"(ftmp[2]), [one]"=&f"(one),
+ [dest]"=&f"(dest), [eight]"=&f"(eight), [sixteen]"=&f"(sixteen),
+ [twenty_four]"=&f"(twenty_four), [forty_eight]"=&f"(forty_eight)
+ : [row]"r"(row), [prev]"r"(prev), [istop]"r"(istop)
+ : "memory"
+ );
+}
+
+void png_read_filter_row_avg4_mmi(png_row_infop row_info, png_bytep row,
+ png_const_bytep prev)
+{
+ int istop = row_info->rowbytes;
+ double rp,pp;
+ double dest;
+ double ftmp[2];
+ double tmp;
+
+ __asm__ volatile (
+ "xor %[dest], %[dest], %[dest] \n\t"
+ "li %[tmp], 0x01 \n\t"
+ "ins %[tmp], %[tmp], 8, 8 \n\t"
+ "dmtc1 %[tmp], %[ftmp1] \n\t"
+ "pshufh %[ftmp1], %[ftmp1], %[dest] \n\t"
+
+ "1: \n\t"
+ "lwc1 %[rp], 0x00(%[row]) \n\t"
+ "lwc1 %[pp], 0x00(%[prev]) \n\t"
+ "xor %[ftmp0], %[pp], %[dest] \n\t"
+ "pavgb %[pp], %[pp], %[dest] \n\t"
+ "and %[ftmp0], %[ftmp0], %[ftmp1] \n\t"
+ "psubb %[pp], %[pp], %[ftmp0] \n\t"
+ "paddb %[dest], %[rp], %[pp] \n\t"
+ "swc1 %[dest], 0x00(%[row]) \n\t"
+ "daddiu %[row], %[row], 0x04 \n\t"
+ "daddiu %[prev], %[prev], 0x04 \n\t"
+ "daddiu %[istop], %[istop], -0x04 \n\t"
+ "bgtz %[istop], 1b \n\t"
+ : [rp]"=&f"(rp), [pp]"=&f"(pp), [ftmp0]"=&f"(ftmp[0]),
+ [ftmp1]"=&f"(ftmp[1]), [dest]"=&f"(dest), [tmp]"=&r"(tmp)
+ : [row]"r"(row), [prev]"r"(prev), [istop]"r"(istop)
+ : "memory"
+ );
+}
+
+void png_read_filter_row_paeth3_mmi(png_row_infop row_info, png_bytep row,
+ png_const_bytep prev)
+{
+ /* Paeth tries to predict pixel d using the pixel to the left of it, a,
+ * and two pixels from the previous row, b and c:
+ * prev: c b
+ * row: a d
+ * The Paeth function predicts d to be whichever of a, b, or c is nearest to
+ * p=a+b-c.
+ *
+ * The first pixel has no left context, and so uses an Up filter, p = b.
+ * This works naturally with our main loop's p = a+b-c if we force a and c
+ * to zero.
+ * Here we zero b and d, which become c and a respectively at the start of
+ * the loop.
+ */
+ int istop = row_info->rowbytes;
+ double rp, pp, rp1, pp1, zero;
+ double a, b, c, d, pa, pb, pc;
+ double tmp0;
+ double ftmp[3];
+ double eight, sixteen, twenty_four, forty_eight;
+
+ __asm__ volatile (
+ "xor %[a], %[a], %[a] \n\t"
+ "xor %[c], %[c], %[c] \n\t"
+ "xor %[zero], %[zero], %[zero] \n\t"
+ "li %[tmp0], 0x08 \n\t"
+ "dmtc1 %[tmp0], %[eight] \n\t"
+ "li %[tmp0], 0x10 \n\t"
+ "dmtc1 %[tmp0], %[sixteen] \n\t"
+ "li %[tmp0], 0x18 \n\t"
+ "dmtc1 %[tmp0], %[twenty_four] \n\t"
+ "li %[tmp0], 0x30 \n\t"
+ "dmtc1 %[tmp0], %[forty_eight] \n\t"
+
+ "1: \n\t"
+ "gsldrc1 %[rp], 0x00(%[row]) \n\t"
+ "gsldlc1 %[rp], 0x07(%[row]) \n\t"
+ "gsldrc1 %[pp], 0x00(%[prev]) \n\t"
+ "gsldlc1 %[pp], 0x07(%[prev]) \n\t"
+ "gsldrc1 %[rp1], 0x08(%[row]) \n\t"
+ "gsldlc1 %[rp1], 0x0f(%[row]) \n\t"
+ "gsldrc1 %[pp1], 0x08(%[prev]) \n\t"
+ "gsldlc1 %[pp1], 0x0f(%[prev]) \n\t"
+
+ "punpcklbh %[b], %[pp], %[zero] \n\t"
+ "punpcklbh %[d], %[rp], %[zero] \n\t"
+ "packushb %[ftmp0], %[c], %[c] \n\t"
+ "packushb %[ftmp1], %[a], %[a] \n\t"
+ "pasubub %[pa], %[pp], %[ftmp0] \n\t"
+ "pasubub %[pb], %[ftmp1], %[ftmp0] \n\t"
+ "psubh %[ftmp0], %[b], %[c] \n\t"
+ "psubh %[ftmp1], %[a], %[c] \n\t"
+ "paddh %[pc], %[ftmp0], %[ftmp1] \n\t"
+ "pcmpgth %[ftmp0], %[zero], %[pc] \n\t"
+ "xor %[pc], %[pc], %[ftmp0] \n\t"
+ "psubh %[pc], %[pc], %[ftmp0] \n\t"
+ "punpcklbh %[pa], %[pa], %[zero] \n\t"
+ "punpcklbh %[pb], %[pb], %[zero] \n\t"
+ "pcmpgth %[ftmp0], %[pa], %[pb] \n\t"
+ "and %[ftmp1], %[b], %[ftmp0] \n\t"
+ "pandn %[a], %[ftmp0], %[a] \n\t"
+ "or %[a], %[a], %[ftmp1] \n\t"
+ "pminsh %[pa], %[pa], %[pb] \n\t"
+ "pcmpgth %[ftmp0], %[pa], %[pc] \n\t"
+ "and %[ftmp1], %[c], %[ftmp0] \n\t"
+ "pandn %[a], %[ftmp0], %[a] \n\t"
+ "or %[a], %[a], %[ftmp1] \n\t"
+ "paddb %[a], %[a], %[d] \n\t"
+ "packushb %[d], %[a], %[a] \n\t"
+ "punpcklbh %[c], %[pp], %[zero] \n\t"
+ "swc1 %[d], 0x00(%[row]) \n\t"
+
+ "dsrl %[ftmp0], %[rp], %[twenty_four] \n\t"
+ "dsrl %[ftmp2], %[pp], %[twenty_four] \n\t"
+
+ "punpcklbh %[b], %[ftmp2], %[zero] \n\t"
+ "punpcklbh %[d], %[ftmp0], %[zero] \n\t"
+ "packushb %[ftmp0], %[c], %[c] \n\t"
+ "packushb %[ftmp1], %[a], %[a] \n\t"
+ "pasubub %[pa], %[ftmp2], %[ftmp0] \n\t"
+ "pasubub %[pb], %[ftmp1], %[ftmp0] \n\t"
+ "psubh %[ftmp0], %[b], %[c] \n\t"
+ "psubh %[ftmp1], %[a], %[c] \n\t"
+ "paddh %[pc], %[ftmp0], %[ftmp1] \n\t"
+ "pcmpgth %[ftmp0], %[zero], %[pc] \n\t"
+ "xor %[pc], %[pc], %[ftmp0] \n\t"
+ "psubh %[pc], %[pc], %[ftmp0] \n\t"
+ "punpcklbh %[pa], %[pa], %[zero] \n\t"
+ "punpcklbh %[pb], %[pb], %[zero] \n\t"
+ "pcmpgth %[ftmp0], %[pa], %[pb] \n\t"
+ "and %[ftmp1], %[b], %[ftmp0] \n\t"
+ "pandn %[a], %[ftmp0], %[a] \n\t"
+ "or %[a], %[a], %[ftmp1] \n\t"
+ "pminsh %[pa], %[pa], %[pb] \n\t"
+ "pcmpgth %[ftmp0], %[pa], %[pc] \n\t"
+ "and %[ftmp1], %[c], %[ftmp0] \n\t"
+ "pandn %[a], %[ftmp0], %[a] \n\t"
+ "or %[a], %[a], %[ftmp1] \n\t"
+ "paddb %[a], %[a], %[d] \n\t"
+ "packushb %[d], %[a], %[a] \n\t"
+ "punpcklbh %[c], %[ftmp2], %[zero] \n\t"
+ "gsswrc1 %[d], 0x03(%[row]) \n\t"
+ "gsswlc1 %[d], 0x06(%[row]) \n\t"
+
+ "dsrl %[ftmp0], %[rp], %[forty_eight] \n\t"
+ "dsll %[ftmp1], %[rp1], %[sixteen] \n\t"
+ "or %[ftmp0], %[ftmp0], %[ftmp1] \n\t"
+ "dsrl %[ftmp2], %[pp], %[forty_eight] \n\t"
+ "dsll %[ftmp1], %[pp1], %[sixteen] \n\t"
+ "or %[ftmp2], %[ftmp2], %[ftmp1] \n\t"
+
+ "punpcklbh %[b], %[ftmp2], %[zero] \n\t"
+ "punpcklbh %[d], %[ftmp0], %[zero] \n\t"
+ "packushb %[ftmp0], %[c], %[c] \n\t"
+ "packushb %[ftmp1], %[a], %[a] \n\t"
+ "pasubub %[pa], %[ftmp2], %[ftmp0] \n\t"
+ "pasubub %[pb], %[ftmp1], %[ftmp0] \n\t"
+ "psubh %[ftmp0], %[b], %[c] \n\t"
+ "psubh %[ftmp1], %[a], %[c] \n\t"
+ "paddh %[pc], %[ftmp0], %[ftmp1] \n\t"
+ "pcmpgth %[ftmp0], %[zero], %[pc] \n\t"
+ "xor %[pc], %[pc], %[ftmp0] \n\t"
+ "psubh %[pc], %[pc], %[ftmp0] \n\t"
+ "punpcklbh %[pa], %[pa], %[zero] \n\t"
+ "punpcklbh %[pb], %[pb], %[zero] \n\t"
+ "pcmpgth %[ftmp0], %[pa], %[pb] \n\t"
+ "and %[ftmp1], %[b], %[ftmp0] \n\t"
+ "pandn %[a], %[ftmp0], %[a] \n\t"
+ "or %[a], %[a], %[ftmp1] \n\t"
+ "pminsh %[pa], %[pa], %[pb] \n\t"
+ "pcmpgth %[ftmp0], %[pa], %[pc] \n\t"
+ "and %[ftmp1], %[c], %[ftmp0] \n\t"
+ "pandn %[a], %[ftmp0], %[a] \n\t"
+ "or %[a], %[a], %[ftmp1] \n\t"
+ "paddb %[a], %[a], %[d] \n\t"
+ "packushb %[d], %[a], %[a] \n\t"
+ "punpcklbh %[c], %[ftmp2], %[zero] \n\t"
+ "gsswrc1 %[d], 0x06(%[row]) \n\t"
+ "gsswlc1 %[d], 0x09(%[row]) \n\t"
+
+ "dsrl %[ftmp0], %[rp1], %[eight] \n\t"
+ "dsrl %[ftmp2], %[pp1], %[eight] \n\t"
+
+ "punpcklbh %[b], %[ftmp2], %[zero] \n\t"
+ "punpcklbh %[d], %[ftmp0], %[zero] \n\t"
+ "packushb %[ftmp0], %[c], %[c] \n\t"
+ "packushb %[ftmp1], %[a], %[a] \n\t"
+ "pasubub %[pa], %[ftmp2], %[ftmp0] \n\t"
+ "pasubub %[pb], %[ftmp1], %[ftmp0] \n\t"
+ "psubh %[ftmp0], %[b], %[c] \n\t"
+ "psubh %[ftmp1], %[a], %[c] \n\t"
+ "paddh %[pc], %[ftmp0], %[ftmp1] \n\t"
+ "pcmpgth %[ftmp0], %[zero], %[pc] \n\t"
+ "xor %[pc], %[pc], %[ftmp0] \n\t"
+ "psubh %[pc], %[pc], %[ftmp0] \n\t"
+ "punpcklbh %[pa], %[pa], %[zero] \n\t"
+ "punpcklbh %[pb], %[pb], %[zero] \n\t"
+ "pcmpgth %[ftmp0], %[pa], %[pb] \n\t"
+ "and %[ftmp1], %[b], %[ftmp0] \n\t"
+ "pandn %[a], %[ftmp0], %[a] \n\t"
+ "or %[a], %[a], %[ftmp1] \n\t"
+ "pminsh %[pa], %[pa], %[pb] \n\t"
+ "pcmpgth %[ftmp0], %[pa], %[pc] \n\t"
+ "and %[ftmp1], %[c], %[ftmp0] \n\t"
+ "pandn %[a], %[ftmp0], %[a] \n\t"
+ "or %[a], %[a], %[ftmp1] \n\t"
+ "paddb %[a], %[a], %[d] \n\t"
+ "packushb %[d], %[a], %[a] \n\t"
+ "punpcklbh %[c], %[ftmp2], %[zero] \n\t"
+ "gsswrc1 %[d], 0x09(%[row]) \n\t"
+
+ "daddiu %[row], %[row], 0x0c \n\t"
+ "daddiu %[prev], %[prev], 0x0c \n\t"
+ "daddiu %[istop], %[istop], -0x0c \n\t"
+ "bgtz %[istop], 1b \n\t"
+ : [rp]"=&f"(rp), [pp]"=&f"(pp), [rp1]"=&f"(rp1), [pp1]"=&f"(pp1),
+ [zero]"=&f"(zero), [a]"=&f"(a),[b]"=&f"(b), [c]"=&f"(c),
+ [d]"=&f"(d), [pa]"=&f"(pa), [pb]"=&f"(pb), [pc]"=&f"(pc),
+ [tmp0]"=&r"(tmp0), [ftmp0]"=&f"(ftmp[0]), [ftmp1]"=&f"(ftmp[1]),
+ [ftmp2]"=&f"(ftmp[2]), [eight]"=&f"(eight), [sixteen]"=&f"(sixteen),
+ [twenty_four]"=&f"(twenty_four), [forty_eight]"=&f"(forty_eight)
+ : [row]"r"(row), [prev]"r"(prev), [istop]"r"(istop)
+ : "memory"
+ );
+}
+
+void png_read_filter_row_paeth4_mmi(png_row_infop row_info, png_bytep row,
+ png_const_bytep prev)
+{
+ /* Paeth tries to predict pixel d using the pixel to the left of it, a,
+ * and two pixels from the previous row, b and c:
+ * prev: c b
+ * row: a d
+ * The Paeth function predicts d to be whichever of a, b, or c is nearest to
+ * p=a+b-c.
+ *
+ * The first pixel has no left context, and so uses an Up filter, p = b.
+ * This works naturally with our main loop's p = a+b-c if we force a and c
+ * to zero.
+ * Here we zero b and d, which become c and a respectively at the start of
+ * the loop.
+ */
+ int istop = row_info->rowbytes;
+ double rp, pp, zero;
+ double a, b, c, d, pa, pb, pc;
+ double ftmp[2];
+
+ __asm__ volatile (
+ "xor %[a], %[a], %[a] \n\t"
+ "xor %[c], %[c], %[c] \n\t"
+ "xor %[zero], %[zero], %[zero] \n\t"
+
+ "1: \n\t"
+ "lwc1 %[rp], 0x00(%[row]) \n\t"
+ "lwc1 %[pp], 0x00(%[prev]) \n\t"
+ "punpcklbh %[b], %[pp], %[zero] \n\t"
+ "punpcklbh %[d], %[rp], %[zero] \n\t"
+
+ "packushb %[ftmp0], %[c], %[c] \n\t"
+ "packushb %[ftmp1], %[a], %[a] \n\t"
+ "pasubub %[pa], %[pp], %[ftmp0] \n\t"
+ "pasubub %[pb], %[ftmp1], %[ftmp0] \n\t"
+ "psubh %[ftmp0], %[b], %[c] \n\t"
+ "psubh %[ftmp1], %[a], %[c] \n\t"
+ "paddh %[pc], %[ftmp0], %[ftmp1] \n\t"
+ "pcmpgth %[ftmp0], %[zero], %[pc] \n\t"
+ "xor %[pc], %[pc], %[ftmp0] \n\t"
+ "psubh %[pc], %[pc], %[ftmp0] \n\t"
+
+ "punpcklbh %[pa], %[pa], %[zero] \n\t"
+ "punpcklbh %[pb], %[pb], %[zero] \n\t"
+
+ "pcmpgth %[ftmp0], %[pa], %[pb] \n\t"
+ "and %[ftmp1], %[b], %[ftmp0] \n\t"
+ "pandn %[a], %[ftmp0], %[a] \n\t"
+ "or %[a], %[a], %[ftmp1] \n\t"
+ "pminsh %[pa], %[pa], %[pb] \n\t"
+
+ "pcmpgth %[ftmp0], %[pa], %[pc] \n\t"
+ "and %[ftmp1], %[c], %[ftmp0] \n\t"
+ "pandn %[a], %[ftmp0], %[a] \n\t"
+ "or %[a], %[a], %[ftmp1] \n\t"
+ "paddb %[a], %[a], %[d] \n\t"
+ "packushb %[d], %[a], %[a] \n\t"
+ "swc1 %[d], 0x00(%[row]) \n\t"
+ "punpcklbh %[c], %[pp], %[zero] \n\t"
+ "daddiu %[row], %[row], 0x04 \n\t"
+ "daddiu %[prev], %[prev], 0x04 \n\t"
+ "daddiu %[istop], %[istop], -0x04 \n\t"
+ "bgtz %[istop], 1b \n\t"
+ : [rp]"=&f"(rp), [pp]"=&f"(pp), [zero]"=&f"(zero),
+ [a]"=&f"(a), [b]"=&f"(b), [c]"=&f"(c), [d]"=&f"(d),
+ [pa]"=&f"(pa), [pb]"=&f"(pb), [pc]"=&f"(pc),
+ [ftmp0]"=&f"(ftmp[0]), [ftmp1]"=&f"(ftmp[1])
+ : [row]"r"(row), [prev]"r"(prev), [istop]"r"(istop)
+ : "memory"
+ );
+}
+
+#endif /* PNG_MIPS_MMI_IMPLEMENTATION > 0 */
+#endif /* READ */
diff --git a/contrib/libs/libpng/mips/filter_msa_intrinsics.c b/contrib/libs/libpng/mips/filter_msa_intrinsics.c
index a579179421..1b734f4d9a 100644
--- a/contrib/libs/libpng/mips/filter_msa_intrinsics.c
+++ b/contrib/libs/libpng/mips/filter_msa_intrinsics.c
@@ -1,9 +1,9 @@
/* filter_msa_intrinsics.c - MSA optimised filter functions
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 2016 Glenn Randers-Pehrson
- * Written by Mandar Sahastrabuddhe, August 2016.
+ * Written by Mandar Sahastrabuddhe, August 2016
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -11,7 +11,6 @@
*/
#include <stdio.h>
-#include <stdint.h>
#include "../pngpriv.h"
#ifdef PNG_READ_SUPPORTED
@@ -20,6 +19,7 @@
#if PNG_MIPS_MSA_IMPLEMENTATION == 1 /* intrinsics code from pngpriv.h */
#include <msa.h>
+#include <stdint.h>
/* libpng row pointers are not necessarily aligned to any particular boundary,
* however this code will only work with appropriate alignment. mips/mips_init.c
@@ -379,8 +379,8 @@ void png_read_filter_row_up_msa(png_row_infop row_info, png_bytep row,
LD_UB4(pp, 16, src4, src5, src6, src7);
pp += 64;
- ADD4(src0, src4, src1, src5, src2, src6, src3, src7,
- src0, src1, src2, src3);
+ ADD4(src0, src4, src1, src5, src2, src6, src3, src7,
+ src0, src1, src2, src3);
ST_UB4(src0, src1, src2, src3, rp, 16);
rp += 64;
@@ -400,7 +400,7 @@ void png_read_filter_row_up_msa(png_row_infop row_info, png_bytep row,
LD_UB4(pp, 16, src4, src5, src6, src7);
ADD4(src0, src4, src1, src5, src2, src6, src3, src7,
- src0, src1, src2, src3);
+ src0, src1, src2, src3);
ST_UB4(src0, src1, src2, src3, rp, 16);
rp += 64;
@@ -425,7 +425,7 @@ void png_read_filter_row_up_msa(png_row_infop row_info, png_bytep row,
LD_UB2(rp, 16, src0, src1);
LD_UB2(pp, 16, src4, src5);
- ADD2(src0, src4, src1, src5, src0, src1);
+ ADD2(src0, src4, src1, src5, src0, src1);
ST_UB2(src0, src1, rp, 16);
rp += 32;
diff --git a/contrib/libs/libpng/mips/mips_init.c b/contrib/libs/libpng/mips/mips_init.c
index 5466dc5a11..28bd45c671 100644
--- a/contrib/libs/libpng/mips/mips_init.c
+++ b/contrib/libs/libpng/mips/mips_init.c
@@ -1,9 +1,10 @@
/* mips_init.c - MSA optimised filter functions
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 2016 Glenn Randers-Pehrson
- * Written by Mandar Sahastrabuddhe, 2016.
+ * Written by Mandar Sahastrabuddhe, 2016
+ * Updated by guxiwei, 2023
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@@ -20,8 +21,9 @@
#ifdef PNG_READ_SUPPORTED
-#if PNG_MIPS_MSA_OPT > 0
-#ifdef PNG_MIPS_MSA_CHECK_SUPPORTED /* Do run-time checks */
+#if PNG_MIPS_MSA_IMPLEMENTATION == 1 || PNG_MIPS_MMI_IMPLEMENTATION > 0
+
+#ifdef PNG_MIPS_MSA_CHECK_SUPPORTED /* Do MIPS MSA run-time checks */
/* WARNING: it is strongly recommended that you do not build libpng with
* run-time checks for CPU features if at all possible. In the case of the MIPS
* MSA instructions there is no processor-specific way of detecting the
@@ -51,13 +53,83 @@ static int png_have_msa(png_structp png_ptr);
#endif /* PNG_MIPS_MSA_FILE */
#endif /* PNG_MIPS_MSA_CHECK_SUPPORTED */
+#ifdef PNG_MIPS_MMI_CHECK_SUPPORTED /* Do MIPS MMI run-times checks */
+#ifndef PNG_MIPS_MMI_FILE
+# ifdef __linux__
+# define PNG_MIPS_MMI_FILE "contrib/mips-mmi/linux.c"
+# endif
+#endif
+
+#ifdef PNG_MIPS_MMI_FILE
+
+#include <signal.h> /* for sig_atomic_t */
+static int png_have_mmi();
+#error #include PNG_MIPS_MMI_FILE
+
+#else /* PNG_MIPS_MMI_FILE */
+# error "PNG_MIPS_MMI_FILE undefined: no support for run-time MIPS MMI checks"
+#endif /* PNG_MIPS_MMI_FILE */
+#endif /* PNG_MIPS_MMI_CHECK_SUPPORTED*/
+
#ifndef PNG_ALIGNED_MEMORY_SUPPORTED
# error "ALIGNED_MEMORY is required; set: -DPNG_ALIGNED_MEMORY_SUPPORTED"
#endif
+/* MIPS supports two optimizations: MMI and MSA. The appropriate
+ * optimization is chosen at runtime
+ */
void
-png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
+png_init_filter_functions_mips(png_structp pp, unsigned int bpp)
{
+#if PNG_MIPS_MMI_IMPLEMENTATION > 0
+#ifdef PNG_MIPS_MMI_API_SUPPORTED
+ switch ((pp->options >> PNG_MIPS_MMI) & 3)
+ {
+ case PNG_OPTION_UNSET:
+#endif /* PNG_MIPS_MMI_API_SUPPORTED */
+#ifdef PNG_MIPS_MMI_CHECK_SUPPORTED
+ {
+ static volatile sig_atomic_t no_mmi = -1; /* not checked */
+
+ if (no_mmi < 0)
+ no_mmi = !png_have_mmi();
+
+ if (no_mmi)
+ goto MIPS_MSA_INIT;
+ }
+#ifdef PNG_MIPS_MMI_API_SUPPORTED
+ break;
+#endif
+#endif /* PNG_MIPS_MMI_CHECK_SUPPORTED */
+
+#ifdef PNG_MIPS_MMI_API_SUPPORTED
+ default: /* OFF or INVALID */
+ goto MIPS_MSA_INIT;
+
+ case PNG_OPTION_ON:
+ /* Option turned on */
+ break;
+ }
+#endif
+ pp->read_filter[PNG_FILTER_VALUE_UP-1] = png_read_filter_row_up_mmi;
+ if (bpp == 3)
+ {
+ pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub3_mmi;
+ pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg3_mmi;
+ pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
+ png_read_filter_row_paeth3_mmi;
+ }
+ else if (bpp == 4)
+ {
+ pp->read_filter[PNG_FILTER_VALUE_SUB-1] = png_read_filter_row_sub4_mmi;
+ pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_mmi;
+ pp->read_filter[PNG_FILTER_VALUE_PAETH-1] =
+ png_read_filter_row_paeth4_mmi;
+ }
+#endif /* PNG_MIPS_MMI_IMPLEMENTATION > 0 */
+
+MIPS_MSA_INIT:
+#if PNG_MIPS_MSA_IMPLEMENTATION == 1
/* The switch statement is compiled in for MIPS_MSA_API, the call to
* png_have_msa is compiled in for MIPS_MSA_CHECK. If both are defined
* the check is only performed if the API has not set the MSA option on
@@ -125,6 +197,8 @@ png_init_filter_functions_msa(png_structp pp, unsigned int bpp)
pp->read_filter[PNG_FILTER_VALUE_AVG-1] = png_read_filter_row_avg4_msa;
pp->read_filter[PNG_FILTER_VALUE_PAETH-1] = png_read_filter_row_paeth4_msa;
}
+#endif /* PNG_MIPS_MSA_IMPLEMENTATION == 1 */
+ return;
}
-#endif /* PNG_MIPS_MSA_OPT > 0 */
+#endif /* PNG_MIPS_MSA_IMPLEMENTATION == 1 || PNG_MIPS_MMI_IMPLEMENTATION > 0 */
#endif /* READ */
diff --git a/contrib/libs/libpng/patches/apng.patch b/contrib/libs/libpng/patches/apng.patch
index 0f7fcdc07b..fe13cc4e79 100644
--- a/contrib/libs/libpng/patches/apng.patch
+++ b/contrib/libs/libpng/patches/apng.patch
@@ -599,7 +599,7 @@ Index: pngwrite.c
#ifdef PNG_GAMMA_SUPPORTED
# ifdef PNG_WRITE_gAMA_SUPPORTED
if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 &&
-@@ -368,7 +372,12 @@
+@@ -368,6 +372,11 @@
if ((png_ptr->mode & PNG_HAVE_IDAT) == 0)
png_error(png_ptr, "No IDATs written into file");
@@ -609,9 +609,8 @@ Index: pngwrite.c
+#endif
+
#ifdef PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED
- if (png_ptr->num_palette_max > png_ptr->num_palette)
- png_benign_error(png_ptr, "Wrote palette index exceeding num_palette");
- #endif
+ if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
+ png_ptr->num_palette_max >= png_ptr->num_palette)
@@ -2415,4 +2424,42 @@
}
#endif /* SIMPLIFIED_WRITE_STDIO */
diff --git a/contrib/libs/libpng/patches/clang-18.patch b/contrib/libs/libpng/patches/clang-18.patch
deleted file mode 100644
index 16f2cda4d9..0000000000
--- a/contrib/libs/libpng/patches/clang-18.patch
+++ /dev/null
@@ -1,26 +0,0 @@
-commit 242ab0166e0b3ae29fd381117df005246a4e4eb9
-merge: 3c801a723b9f0eca043275e810f76c9286a7e0ab 6626b8f9a0ad0f481d29b698fbe42d5158b49aae
-author: robot-brewer
-date: 2024-11-11T09:16:28+03:00
-revision: 15280800
-
- Release clang18 #3
-
- https://github.com/yandex/toolchain-registry/releases/tag/clang18-v3
-
- REVIEW: 7167654
-
---- contrib/libs/libpng/pngpriv.h (3c801a723b9f0eca043275e810f76c9286a7e0ab)
-+++ contrib/libs/libpng/pngpriv.h (242ab0166e0b3ae29fd381117df005246a4e4eb9)
-@@ -514,6 +514,11 @@
- */
- # include <float.h>
-
-+#if defined(__clang__) && __clang_major__ >= 17
-+#include <math.h>
-+#define __MATH_H__
-+#endif
-+
- # if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
- /* We need to check that <math.h> hasn't already been included earlier
diff --git a/contrib/libs/libpng/png.c b/contrib/libs/libpng/png.c
index d6471b06cc..9a9fb23d94 100644
--- a/contrib/libs/libpng/png.c
+++ b/contrib/libs/libpng/png.c
@@ -1,7 +1,7 @@
/* png.c - location for general purpose libpng functions
*
- * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
@@ -14,27 +14,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_40 Your_png_h_is_not_version_1_6_40;
-
-#ifdef __GNUC__
-/* The version tests may need to be added to, but the problem warning has
- * consistently been fixed in GCC versions which obtain wide-spread release.
- * The problem is that many versions of GCC rearrange comparison expressions in
- * the optimizer in such a way that the results of the comparison will change
- * if signed integer overflow occurs. Such comparisons are not permitted in
- * ANSI C90, however GCC isn't clever enough to work out that that do not occur
- * below in png_ascii_from_fp and png_muldiv, so it produces a warning with
- * -Wextra. Unfortunately this is highly dependent on the optimizer and the
- * machine architecture so the warning comes and goes unpredictably and is
- * impossible to "fix", even were that a good idea.
- */
-#if __GNUC__ == 7 && __GNUC_MINOR__ == 1
-#define GCC_STRICT_OVERFLOW 1
-#endif /* GNU 7.1.x */
-#endif /* GNU */
-#ifndef GCC_STRICT_OVERFLOW
-#define GCC_STRICT_OVERFLOW 0
-#endif
+typedef png_libpng_version_1_6_44 Your_png_h_is_not_version_1_6_44;
/* Tells libpng that we have already handled the first "num_bytes" bytes
* of the PNG file signature. If the PNG data is embedded into another
@@ -73,21 +53,21 @@ png_set_sig_bytes(png_structrp png_ptr, int num_bytes)
int PNGAPI
png_sig_cmp(png_const_bytep sig, size_t start, size_t num_to_check)
{
- png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
+ static const png_byte png_signature[8] = {137, 80, 78, 71, 13, 10, 26, 10};
if (num_to_check > 8)
num_to_check = 8;
else if (num_to_check < 1)
- return (-1);
+ return -1;
if (start > 7)
- return (-1);
+ return -1;
if (start + num_to_check > 8)
num_to_check = 8 - start;
- return ((int)(memcmp(&sig[start], &png_signature[start], num_to_check)));
+ return memcmp(&sig[start], &png_signature[start], num_to_check);
}
#endif /* READ */
@@ -447,7 +427,6 @@ png_info_init_3,(png_infopp ptr_ptr, size_t png_info_struct_size),
memset(info_ptr, 0, (sizeof *info_ptr));
}
-/* The following API is not called internally */
void PNGAPI
png_data_freer(png_const_structrp png_ptr, png_inforp info_ptr,
int freer, png_uint_32 mask)
@@ -686,9 +665,9 @@ png_voidp PNGAPI
png_get_io_ptr(png_const_structrp png_ptr)
{
if (png_ptr == NULL)
- return (NULL);
+ return NULL;
- return (png_ptr->io_ptr);
+ return png_ptr->io_ptr;
}
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
@@ -752,7 +731,7 @@ png_convert_to_rfc1123_buffer(char out[29], png_const_timep ptime)
{
size_t pos = 0;
- char number_buf[5]; /* enough for a four-digit year */
+ char number_buf[5] = {0, 0, 0, 0, 0}; /* enough for a four-digit year */
# define APPEND_STRING(string) pos = png_safecat(out, 29, pos, (string))
# define APPEND_NUMBER(format, value)\
@@ -815,8 +794,8 @@ png_get_copyright(png_const_structrp png_ptr)
return PNG_STRING_COPYRIGHT
#else
return PNG_STRING_NEWLINE \
- "libpng version 1.6.40" PNG_STRING_NEWLINE \
- "Copyright (c) 2018-2023 Cosmin Truta" PNG_STRING_NEWLINE \
+ "libpng version 1.6.44" PNG_STRING_NEWLINE \
+ "Copyright (c) 2018-2024 Cosmin Truta" PNG_STRING_NEWLINE \
"Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \
PNG_STRING_NEWLINE \
"Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \
@@ -977,7 +956,7 @@ png_reset_zstream(png_structrp png_ptr)
return Z_STREAM_ERROR;
/* WARNING: this resets the window bits to the maximum! */
- return (inflateReset(&png_ptr->zstream));
+ return inflateReset(&png_ptr->zstream);
}
#endif /* READ */
@@ -986,7 +965,7 @@ png_uint_32 PNGAPI
png_access_version_number(void)
{
/* Version of *.c files used when building libpng */
- return((png_uint_32)PNG_LIBPNG_VER);
+ return (png_uint_32)PNG_LIBPNG_VER;
}
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
@@ -1224,6 +1203,24 @@ png_colorspace_sync(png_const_structrp png_ptr, png_inforp info_ptr)
#endif /* GAMMA */
#ifdef PNG_COLORSPACE_SUPPORTED
+static int
+png_safe_add(png_int_32 *addend0_and_result, png_int_32 addend1,
+ png_int_32 addend2) {
+ /* Safely add three integers. Returns 0 on success, 1 on overlow.
+ * IMPLEMENTATION NOTE: ANSI requires signed overflow not to occur, therefore
+ * relying on addition of two positive values producing a negative one is not
+ * safe.
+ */
+ int addend0 = *addend0_and_result;
+ if (0x7fffffff - addend0 < addend1)
+ return 1;
+ addend0 += addend1;
+ if (0x7fffffff - addend1 < addend2)
+ return 1;
+ *addend0_and_result = addend0 + addend2;
+ return 0;
+}
+
/* Added at libpng-1.5.5 to support read and write of true CIEXYZ values for
* cHRM, as opposed to using chromaticities. These internal APIs return
* non-zero on a parameter error. The X, Y and Z values are required to be
@@ -1232,38 +1229,52 @@ png_colorspace_sync(png_const_structrp png_ptr, png_inforp info_ptr)
static int
png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ)
{
- png_int_32 d, dwhite, whiteX, whiteY;
+ png_int_32 d, dred, dgreen, dwhite, whiteX, whiteY;
- d = XYZ->red_X + XYZ->red_Y + XYZ->red_Z;
+ /* 'd' in each of the blocks below is just X+Y+Z for each component,
+ * x, y and z are X,Y,Z/(X+Y+Z).
+ */
+ d = XYZ->red_X;
+ if (png_safe_add(&d, XYZ->red_Y, XYZ->red_Z))
+ return 1;
if (png_muldiv(&xy->redx, XYZ->red_X, PNG_FP_1, d) == 0)
return 1;
if (png_muldiv(&xy->redy, XYZ->red_Y, PNG_FP_1, d) == 0)
return 1;
- dwhite = d;
+ dred = d;
whiteX = XYZ->red_X;
whiteY = XYZ->red_Y;
- d = XYZ->green_X + XYZ->green_Y + XYZ->green_Z;
+ d = XYZ->green_X;
+ if (png_safe_add(&d, XYZ->green_Y, XYZ->green_Z))
+ return 1;
if (png_muldiv(&xy->greenx, XYZ->green_X, PNG_FP_1, d) == 0)
return 1;
if (png_muldiv(&xy->greeny, XYZ->green_Y, PNG_FP_1, d) == 0)
return 1;
- dwhite += d;
+ dgreen = d;
whiteX += XYZ->green_X;
whiteY += XYZ->green_Y;
- d = XYZ->blue_X + XYZ->blue_Y + XYZ->blue_Z;
+ d = XYZ->blue_X;
+ if (png_safe_add(&d, XYZ->blue_Y, XYZ->blue_Z))
+ return 1;
if (png_muldiv(&xy->bluex, XYZ->blue_X, PNG_FP_1, d) == 0)
return 1;
if (png_muldiv(&xy->bluey, XYZ->blue_Y, PNG_FP_1, d) == 0)
return 1;
- dwhite += d;
whiteX += XYZ->blue_X;
whiteY += XYZ->blue_Y;
- /* The reference white is simply the sum of the end-point (X,Y,Z) vectors,
- * thus:
+ /* The reference white is simply the sum of the end-point (X,Y,Z) vectors so
+ * the fillowing calculates (X+Y+Z) of the reference white (media white,
+ * encoding white) itself:
*/
+ if (png_safe_add(&d, dred, dgreen))
+ return 1;
+
+ dwhite = d;
+
if (png_muldiv(&xy->whitex, whiteX, PNG_FP_1, dwhite) == 0)
return 1;
if (png_muldiv(&xy->whitey, whiteY, PNG_FP_1, dwhite) == 0)
@@ -1278,20 +1289,6 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
png_fixed_point red_inverse, green_inverse, blue_scale;
png_fixed_point left, right, denominator;
- /* Check xy and, implicitly, z. Note that wide gamut color spaces typically
- * have end points with 0 tristimulus values (these are impossible end
- * points, but they are used to cover the possible colors). We check
- * xy->whitey against 5, not 0, to avoid a possible integer overflow.
- */
- if (xy->redx < 0 || xy->redx > PNG_FP_1) return 1;
- if (xy->redy < 0 || xy->redy > PNG_FP_1-xy->redx) return 1;
- if (xy->greenx < 0 || xy->greenx > PNG_FP_1) return 1;
- if (xy->greeny < 0 || xy->greeny > PNG_FP_1-xy->greenx) return 1;
- if (xy->bluex < 0 || xy->bluex > PNG_FP_1) return 1;
- if (xy->bluey < 0 || xy->bluey > PNG_FP_1-xy->bluex) return 1;
- if (xy->whitex < 0 || xy->whitex > PNG_FP_1) return 1;
- if (xy->whitey < 5 || xy->whitey > PNG_FP_1-xy->whitex) return 1;
-
/* The reverse calculation is more difficult because the original tristimulus
* value had 9 independent values (red,green,blue)x(X,Y,Z) however only 8
* derived values were recorded in the cHRM chunk;
@@ -1472,16 +1469,16 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
* value of 2 indicates an internal error to the caller.
*/
if (png_muldiv(&left, xy->greenx-xy->bluex, xy->redy - xy->bluey, 7) == 0)
- return 2;
+ return 1;
if (png_muldiv(&right, xy->greeny-xy->bluey, xy->redx - xy->bluex, 7) == 0)
- return 2;
+ return 1;
denominator = left - right;
/* Now find the red numerator. */
if (png_muldiv(&left, xy->greenx-xy->bluex, xy->whitey-xy->bluey, 7) == 0)
- return 2;
+ return 1;
if (png_muldiv(&right, xy->greeny-xy->bluey, xy->whitex-xy->bluex, 7) == 0)
- return 2;
+ return 1;
/* Overflow is possible here and it indicates an extreme set of PNG cHRM
* chunk values. This calculation actually returns the reciprocal of the
@@ -1494,9 +1491,9 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
/* Similarly for green_inverse: */
if (png_muldiv(&left, xy->redy-xy->bluey, xy->whitex-xy->bluex, 7) == 0)
- return 2;
+ return 1;
if (png_muldiv(&right, xy->redx-xy->bluex, xy->whitey-xy->bluey, 7) == 0)
- return 2;
+ return 1;
if (png_muldiv(&green_inverse, xy->whitey, denominator, left-right) == 0 ||
green_inverse <= xy->whitey)
return 1;
@@ -1541,25 +1538,14 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy)
static int
png_XYZ_normalize(png_XYZ *XYZ)
{
- png_int_32 Y;
+ png_int_32 Y, Ytemp;
- if (XYZ->red_Y < 0 || XYZ->green_Y < 0 || XYZ->blue_Y < 0 ||
- XYZ->red_X < 0 || XYZ->green_X < 0 || XYZ->blue_X < 0 ||
- XYZ->red_Z < 0 || XYZ->green_Z < 0 || XYZ->blue_Z < 0)
+ /* Normalize by scaling so the sum of the end-point Y values is PNG_FP_1. */
+ Ytemp = XYZ->red_Y;
+ if (png_safe_add(&Ytemp, XYZ->green_Y, XYZ->blue_Y))
return 1;
- /* Normalize by scaling so the sum of the end-point Y values is PNG_FP_1.
- * IMPLEMENTATION NOTE: ANSI requires signed overflow not to occur, therefore
- * relying on addition of two positive values producing a negative one is not
- * safe.
- */
- Y = XYZ->red_Y;
- if (0x7fffffff - Y < XYZ->green_X)
- return 1;
- Y += XYZ->green_Y;
- if (0x7fffffff - Y < XYZ->blue_X)
- return 1;
- Y += XYZ->blue_Y;
+ Y = Ytemp;
if (Y != PNG_FP_1)
{
@@ -1842,14 +1828,14 @@ png_icc_profile_error(png_const_structrp png_ptr, png_colorspacerp colorspace,
}
# ifdef PNG_WARNINGS_SUPPORTED
else
- {
- char number[PNG_NUMBER_BUFFER_SIZE]; /* +24 = 114 */
+ {
+ char number[PNG_NUMBER_BUFFER_SIZE]; /* +24 = 114 */
- pos = png_safecat(message, (sizeof message), pos,
- png_format_number(number, number+(sizeof number),
- PNG_NUMBER_FORMAT_x, value));
- pos = png_safecat(message, (sizeof message), pos, "h: "); /* +2 = 116 */
- }
+ pos = png_safecat(message, (sizeof message), pos,
+ png_format_number(number, number+(sizeof number),
+ PNG_NUMBER_FORMAT_x, value));
+ pos = png_safecat(message, (sizeof message), pos, "h: "); /* +2 = 116 */
+ }
# endif
/* The 'reason' is an arbitrary message, allow +79 maximum 195 */
pos = png_safecat(message, (sizeof message), pos, reason);
@@ -2532,17 +2518,6 @@ png_colorspace_set_rgb_coefficients(png_structrp png_ptr)
#endif /* COLORSPACE */
-#ifdef __GNUC__
-/* This exists solely to work round a warning from GNU C. */
-static int /* PRIVATE */
-png_gt(size_t a, size_t b)
-{
- return a > b;
-}
-#else
-# define png_gt(a,b) ((a) > (b))
-#endif
-
void /* PRIVATE */
png_check_IHDR(png_const_structrp png_ptr,
png_uint_32 width, png_uint_32 height, int bit_depth,
@@ -2564,8 +2539,16 @@ png_check_IHDR(png_const_structrp png_ptr,
error = 1;
}
- if (png_gt(((width + 7) & (~7U)),
- ((PNG_SIZE_MAX
+ /* The bit mask on the first line below must be at least as big as a
+ * png_uint_32. "~7U" is not adequate on 16-bit systems because it will
+ * be an unsigned 16-bit value. Casting to (png_alloc_size_t) makes the
+ * type of the result at least as bit (in bits) as the RHS of the > operator
+ * which also avoids a common warning on 64-bit systems that the comparison
+ * of (png_uint_32) against the constant value on the RHS will always be
+ * false.
+ */
+ if (((width + 7) & ~(png_alloc_size_t)7) >
+ (((PNG_SIZE_MAX
- 48 /* big_row_buf hack */
- 1) /* filter byte */
/ 8) /* 8-byte RGBA pixels */
@@ -2891,14 +2874,6 @@ png_pow10(int power)
/* Function to format a floating point value in ASCII with a given
* precision.
*/
-#if GCC_STRICT_OVERFLOW
-#pragma GCC diagnostic push
-/* The problem arises below with exp_b10, which can never overflow because it
- * comes, originally, from frexp and is therefore limited to a range which is
- * typically +/-710 (log2(DBL_MAX)/log2(DBL_MIN)).
- */
-#pragma GCC diagnostic warning "-Wstrict-overflow=2"
-#endif /* GCC_STRICT_OVERFLOW */
void /* PRIVATE */
png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, size_t size,
double fp, unsigned int precision)
@@ -3220,10 +3195,6 @@ png_ascii_from_fp(png_const_structrp png_ptr, png_charp ascii, size_t size,
/* Here on buffer too small. */
png_error(png_ptr, "ASCII conversion buffer too small");
}
-#if GCC_STRICT_OVERFLOW
-#pragma GCC diagnostic pop
-#endif /* GCC_STRICT_OVERFLOW */
-
# endif /* FLOATING_POINT */
# ifdef PNG_FIXED_POINT_SUPPORTED
@@ -3251,7 +3222,7 @@ png_ascii_from_fixed(png_const_structrp png_ptr, png_charp ascii,
if (num <= 0x80000000) /* else overflowed */
{
unsigned int ndigits = 0, first = 16 /* flag value */;
- char digits[10];
+ char digits[10] = {0};
while (num)
{
@@ -3336,15 +3307,6 @@ png_fixed(png_const_structrp png_ptr, double fp, png_const_charp text)
* the nearest .00001). Overflow and divide by zero are signalled in
* the result, a boolean - true on success, false on overflow.
*/
-#if GCC_STRICT_OVERFLOW /* from above */
-/* It is not obvious which comparison below gets optimized in such a way that
- * signed overflow would change the result; looking through the code does not
- * reveal any tests which have the form GCC complains about, so presumably the
- * optimizer is moving an add or subtract into the 'if' somewhere.
- */
-#pragma GCC diagnostic push
-#pragma GCC diagnostic warning "-Wstrict-overflow=2"
-#endif /* GCC_STRICT_OVERFLOW */
int
png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
png_int_32 divisor)
@@ -3459,9 +3421,6 @@ png_muldiv(png_fixed_point_p res, png_fixed_point a, png_int_32 times,
return 0;
}
-#if GCC_STRICT_OVERFLOW
-#pragma GCC diagnostic pop
-#endif /* GCC_STRICT_OVERFLOW */
#endif /* READ_GAMMA || INCH_CONVERSIONS */
#if defined(PNG_READ_GAMMA_SUPPORTED) || defined(PNG_INCH_CONVERSIONS_SUPPORTED)
diff --git a/contrib/libs/libpng/png.h b/contrib/libs/libpng/png.h
index 7a9848eb12..8cd8f041e0 100644
--- a/contrib/libs/libpng/png.h
+++ b/contrib/libs/libpng/png.h
@@ -1,9 +1,9 @@
/* png.h - header file for PNG reference library
*
- * libpng version 1.6.40
+ * libpng version 1.6.44
*
- * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
@@ -15,7 +15,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.40, June 2023:
+ * libpng versions 1.6.36, December 2018, through 1.6.44, September 2024:
* Cosmin Truta
* See also "Contributing Authors", below.
*/
@@ -33,8 +33,8 @@
* PNG Reference Library License version 2
* ---------------------------------------
*
- * * Copyright (c) 1995-2023 The PNG Reference Library Authors.
- * * Copyright (c) 2018-2023 Cosmin Truta.
+ * * Copyright (c) 1995-2024 The PNG Reference Library Authors.
+ * * Copyright (c) 2018-2024 Cosmin Truta.
* * Copyright (c) 2000-2002, 2004, 2006-2018 Glenn Randers-Pehrson.
* * Copyright (c) 1996-1997 Andreas Dilger.
* * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -245,7 +245,7 @@
* ...
* 1.5.30 15 10530 15.so.15.30[.0]
* ...
- * 1.6.40 16 10640 16.so.16.40[.0]
+ * 1.6.44 16 10644 16.so.16.44[.0]
*
* Henceforth the source version will match the shared-library major and
* minor numbers; the shared-library major version number will be used for
@@ -261,9 +261,6 @@
* to the info_ptr or png_ptr members through png.h, and the compiled
* application is loaded with a different version of the library.
*
- * DLLNUM will change each time there are forward or backward changes
- * in binary compatibility (e.g., when a new feature is added).
- *
* See libpng.txt or libpng.3 for more information. The PNG specification
* is available as a W3C Recommendation and as an ISO/IEC Standard; see
* <https://www.w3.org/TR/2003/REC-PNG-20031110/>
@@ -284,27 +281,29 @@
*/
/* Version information for png.h - this should match the version in png.c */
-#define PNG_LIBPNG_VER_STRING "1.6.40"
-#define PNG_HEADER_VERSION_STRING " libpng version 1.6.40 - June 21, 2023\n"
+#define PNG_LIBPNG_VER_STRING "1.6.44"
+#define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n"
-#define PNG_LIBPNG_VER_SONUM 16
-#define PNG_LIBPNG_VER_DLLNUM 16
+/* The versions of shared library builds should stay in sync, going forward */
+#define PNG_LIBPNG_VER_SHAREDLIB 16
+#define PNG_LIBPNG_VER_SONUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */
+#define PNG_LIBPNG_VER_DLLNUM PNG_LIBPNG_VER_SHAREDLIB /* [Deprecated] */
/* 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 40
+#define PNG_LIBPNG_VER_RELEASE 44
/* This should be zero for a public release, or non-zero for a
- * development version. [Deprecated]
+ * development version.
*/
-#define PNG_LIBPNG_VER_BUILD 0
+#define PNG_LIBPNG_VER_BUILD 0
/* Release Status */
-#define PNG_LIBPNG_BUILD_ALPHA 1
-#define PNG_LIBPNG_BUILD_BETA 2
-#define PNG_LIBPNG_BUILD_RC 3
-#define PNG_LIBPNG_BUILD_STABLE 4
+#define PNG_LIBPNG_BUILD_ALPHA 1
+#define PNG_LIBPNG_BUILD_BETA 2
+#define PNG_LIBPNG_BUILD_RC 3
+#define PNG_LIBPNG_BUILD_STABLE 4
#define PNG_LIBPNG_BUILD_RELEASE_STATUS_MASK 7
/* Release-Specific Flags */
@@ -324,7 +323,7 @@
* From version 1.0.1 it is:
* XXYYZZ, where XX=major, YY=minor, ZZ=release
*/
-#define PNG_LIBPNG_VER 10640 /* 1.6.40 */
+#define PNG_LIBPNG_VER 10644 /* 1.6.44 */
/* Library configuration: these options cannot be changed after
* the library has been built.
@@ -449,7 +448,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_40;
+typedef char* png_libpng_version_1_6_44;
/* Basic control structions. Read libpng-manual.txt or libpng.3 for more info.
*
@@ -854,7 +853,7 @@ typedef PNG_CALLBACK(int, *png_user_chunk_ptr, (png_structp,
* your compiler. This may be very difficult - try using a different compiler
* to build the library!
*/
-PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);
+PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), (jmp_buf, int), typedef);
#endif
/* Transform masks for the high-level interface */
@@ -878,7 +877,7 @@ PNG_FUNCTION(void, (PNGCAPI *png_longjmp_ptr), PNGARG((jmp_buf, int)), typedef);
#define PNG_TRANSFORM_GRAY_TO_RGB 0x2000 /* read only */
/* Added to libpng-1.5.4 */
#define PNG_TRANSFORM_EXPAND_16 0x4000 /* read only */
-#if INT_MAX >= 0x8000 /* else this might break */
+#if ~0U > 0xffffU /* or else this might break on a 16-bit machine */
#define PNG_TRANSFORM_SCALE_16 0x8000 /* read only */
#endif
@@ -937,15 +936,15 @@ PNG_EXPORT(2, void, png_set_sig_bytes, (png_structrp png_ptr, int num_bytes));
/* Check sig[start] through sig[start + num_to_check - 1] to see if it's a
* PNG file. Returns zero if the supplied bytes match the 8-byte PNG
* signature, and non-zero otherwise. Having num_to_check == 0 or
- * start > 7 will always fail (ie return non-zero).
+ * start > 7 will always fail (i.e. return non-zero).
*/
PNG_EXPORT(3, int, png_sig_cmp, (png_const_bytep sig, size_t start,
size_t num_to_check));
/* Simple signature checking function. This is the same as calling
- * png_check_sig(sig, n) := !png_sig_cmp(sig, 0, n).
+ * png_check_sig(sig, n) := (png_sig_cmp(sig, 0, n) == 0).
*/
-#define png_check_sig(sig, n) !png_sig_cmp((sig), 0, (n))
+#define png_check_sig(sig, n) (png_sig_cmp((sig), 0, (n)) == 0) /* DEPRECATED */
/* Allocate and initialize png_ptr struct for reading, and any other memory. */
PNG_EXPORTA(4, png_structp, png_create_read_struct,
@@ -1759,12 +1758,9 @@ PNG_EXPORT(97, void, png_free, (png_const_structrp png_ptr, png_voidp ptr));
PNG_EXPORT(98, void, png_free_data, (png_const_structrp png_ptr,
png_inforp info_ptr, png_uint_32 free_me, int num));
-/* Reassign responsibility for freeing existing data, whether allocated
+/* Reassign the responsibility for freeing existing data, whether allocated
* by libpng or by the application; this works on the png_info structure passed
- * in, it does not change the state for other png_info structures.
- *
- * It is unlikely that this function works correctly as of 1.6.0 and using it
- * may result either in memory leaks or double free of allocated data.
+ * in, without changing the state for other png_info structures.
*/
PNG_EXPORT(99, void, png_data_freer, (png_const_structrp png_ptr,
png_inforp info_ptr, int freer, png_uint_32 mask));
@@ -3236,11 +3232,18 @@ PNG_EXPORT(245, int, png_image_write_to_memory, (png_imagep image, void *memory,
#ifdef PNG_MIPS_MSA_API_SUPPORTED
# define PNG_MIPS_MSA 6 /* HARDWARE: MIPS Msa SIMD instructions supported */
#endif
-#define PNG_IGNORE_ADLER32 8
+#ifdef PNG_DISABLE_ADLER32_CHECK_SUPPORTED
+# define PNG_IGNORE_ADLER32 8 /* SOFTWARE: disable Adler32 check on IDAT */
+#endif
#ifdef PNG_POWERPC_VSX_API_SUPPORTED
-# define PNG_POWERPC_VSX 10 /* HARDWARE: PowerPC VSX SIMD instructions supported */
+# define PNG_POWERPC_VSX 10 /* HARDWARE: PowerPC VSX SIMD instructions
+ * supported */
#endif
-#define PNG_OPTION_NEXT 12 /* Next option - numbers must be even */
+#ifdef PNG_MIPS_MMI_API_SUPPORTED
+# define PNG_MIPS_MMI 12 /* HARDWARE: MIPS MMI SIMD instructions supported */
+#endif
+
+#define PNG_OPTION_NEXT 14 /* Next option - numbers must be even */
/* Return values: NOTE: there are four values and 'off' is *not* zero */
#define PNG_OPTION_UNSET 0 /* Unset - defaults to off */
diff --git a/contrib/libs/libpng/pngconf.h b/contrib/libs/libpng/pngconf.h
index 6671e3c335..4a4b58ac81 100644
--- a/contrib/libs/libpng/pngconf.h
+++ b/contrib/libs/libpng/pngconf.h
@@ -1,9 +1,9 @@
/* pngconf.h - machine-configurable file for libpng
*
- * libpng version 1.6.40
+ * libpng version 1.6.44
*
- * Copyright (c) 2018-2022 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
@@ -88,7 +88,7 @@
/* The PNGARG macro was used in versions of libpng prior to 1.6.0 to protect
* against legacy (pre ISOC90) compilers that did not understand function
- * prototypes. It is not required for modern C compilers.
+ * prototypes. [Deprecated.]
*/
#ifndef PNGARG
# define PNGARG(arglist) arglist
@@ -298,7 +298,7 @@
#ifndef PNG_EXPORTA
# define PNG_EXPORTA(ordinal, type, name, args, attributes) \
- PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), PNGARG(args), \
+ PNG_FUNCTION(PNG_EXPORT_TYPE(type), (PNGAPI name), args, \
PNG_LINKAGE_API attributes)
#endif
@@ -316,7 +316,7 @@
#endif
#ifndef PNG_CALLBACK
-# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) PNGARG(args)
+# define PNG_CALLBACK(type, name, args) type (PNGCBAPI name) args
#endif
/* Support for compiler specific function attributes. These are used
diff --git a/contrib/libs/libpng/pngerror.c b/contrib/libs/libpng/pngerror.c
index ec3a709b9d..1babf9f8d2 100644
--- a/contrib/libs/libpng/pngerror.c
+++ b/contrib/libs/libpng/pngerror.c
@@ -1,7 +1,7 @@
/* pngerror.c - stub functions for i/o and memory allocation
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
@@ -20,13 +20,14 @@
#if defined(PNG_READ_SUPPORTED) || defined(PNG_WRITE_SUPPORTED)
-static PNG_FUNCTION(void, png_default_error,PNGARG((png_const_structrp png_ptr,
- png_const_charp error_message)),PNG_NORETURN);
+static PNG_FUNCTION(void /* PRIVATE */,
+png_default_error,(png_const_structrp png_ptr, png_const_charp error_message),
+ PNG_NORETURN);
#ifdef PNG_WARNINGS_SUPPORTED
static void /* PRIVATE */
-png_default_warning PNGARG((png_const_structrp png_ptr,
- png_const_charp warning_message));
+png_default_warning(png_const_structrp png_ptr,
+ png_const_charp warning_message);
#endif /* WARNINGS */
/* This function is called whenever there is a fatal error. This function
@@ -255,7 +256,7 @@ void
png_warning_parameter_unsigned(png_warning_parameters p, int number, int format,
png_alloc_size_t value)
{
- char buffer[PNG_NUMBER_BUFFER_SIZE];
+ char buffer[PNG_NUMBER_BUFFER_SIZE] = {0};
png_warning_parameter(p, number, PNG_FORMAT_NUMBER(buffer, format, value));
}
@@ -265,7 +266,7 @@ png_warning_parameter_signed(png_warning_parameters p, int number, int format,
{
png_alloc_size_t u;
png_charp str;
- char buffer[PNG_NUMBER_BUFFER_SIZE];
+ char buffer[PNG_NUMBER_BUFFER_SIZE] = {0};
/* Avoid overflow by doing the negate in a png_alloc_size_t: */
u = (png_alloc_size_t)value;
@@ -858,7 +859,7 @@ png_get_error_ptr(png_const_structrp png_ptr)
if (png_ptr == NULL)
return NULL;
- return ((png_voidp)png_ptr->error_ptr);
+ return (png_voidp)png_ptr->error_ptr;
}
@@ -933,31 +934,25 @@ png_safe_warning(png_structp png_nonconst_ptr, png_const_charp warning_message)
#endif
int /* PRIVATE */
-png_safe_execute(png_imagep image_in, int (*function)(png_voidp), png_voidp arg)
+png_safe_execute(png_imagep image, int (*function)(png_voidp), png_voidp arg)
{
- volatile png_imagep image = image_in;
- volatile int result;
- volatile png_voidp saved_error_buf;
+ png_voidp saved_error_buf = image->opaque->error_buf;
jmp_buf safe_jmpbuf;
+ int result;
- /* Safely execute function(arg) with png_error returning to this function. */
- saved_error_buf = image->opaque->error_buf;
- result = setjmp(safe_jmpbuf) == 0;
-
- if (result != 0)
+ /* Safely execute function(arg), with png_error returning back here. */
+ if (setjmp(safe_jmpbuf) == 0)
{
-
image->opaque->error_buf = safe_jmpbuf;
result = function(arg);
+ image->opaque->error_buf = saved_error_buf;
+ return result;
}
+ /* On png_error, return via longjmp, pop the jmpbuf, and free the image. */
image->opaque->error_buf = saved_error_buf;
-
- /* And do the cleanup prior to any failure return. */
- if (result == 0)
- png_image_free(image);
-
- return result;
+ png_image_free(image);
+ return 0;
}
#endif /* SIMPLIFIED READ || SIMPLIFIED_WRITE */
#endif /* READ || WRITE */
diff --git a/contrib/libs/libpng/pngget.c b/contrib/libs/libpng/pngget.c
index 5d8562e364..9c7977b287 100644
--- a/contrib/libs/libpng/pngget.c
+++ b/contrib/libs/libpng/pngget.c
@@ -1,7 +1,7 @@
/* pngget.c - retrieval of values from info struct
*
- * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
@@ -28,22 +28,22 @@ png_get_valid(png_const_structrp png_ptr, png_const_inforp info_ptr,
* valid tRNS chunk in this case.
*/
if (flag == PNG_INFO_tRNS && png_ptr->num_trans == 0)
- return(0);
+ return 0;
#endif
- return(info_ptr->valid & flag);
+ return info_ptr->valid & flag;
}
- return(0);
+ return 0;
}
size_t PNGAPI
png_get_rowbytes(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
- return(info_ptr->rowbytes);
+ return info_ptr->rowbytes;
- return(0);
+ return 0;
}
#ifdef PNG_INFO_IMAGE_SUPPORTED
@@ -51,9 +51,9 @@ png_bytepp PNGAPI
png_get_rows(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
- return(info_ptr->row_pointers);
+ return info_ptr->row_pointers;
- return(0);
+ return 0;
}
#endif
@@ -65,7 +65,7 @@ png_get_image_width(png_const_structrp png_ptr, png_const_inforp info_ptr)
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->width;
- return (0);
+ return 0;
}
png_uint_32 PNGAPI
@@ -74,7 +74,7 @@ png_get_image_height(png_const_structrp png_ptr, png_const_inforp info_ptr)
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->height;
- return (0);
+ return 0;
}
png_byte PNGAPI
@@ -83,7 +83,7 @@ png_get_bit_depth(png_const_structrp png_ptr, png_const_inforp info_ptr)
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->bit_depth;
- return (0);
+ return 0;
}
png_byte PNGAPI
@@ -92,7 +92,7 @@ png_get_color_type(png_const_structrp png_ptr, png_const_inforp info_ptr)
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->color_type;
- return (0);
+ return 0;
}
png_byte PNGAPI
@@ -101,7 +101,7 @@ png_get_filter_type(png_const_structrp png_ptr, png_const_inforp info_ptr)
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->filter_type;
- return (0);
+ return 0;
}
png_byte PNGAPI
@@ -110,7 +110,7 @@ png_get_interlace_type(png_const_structrp png_ptr, png_const_inforp info_ptr)
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->interlace_type;
- return (0);
+ return 0;
}
png_byte PNGAPI
@@ -119,7 +119,7 @@ png_get_compression_type(png_const_structrp png_ptr, png_const_inforp info_ptr)
if (png_ptr != NULL && info_ptr != NULL)
return info_ptr->compression_type;
- return (0);
+ return 0;
}
png_uint_32 PNGAPI
@@ -127,21 +127,20 @@ png_get_x_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp
info_ptr)
{
#ifdef PNG_pHYs_SUPPORTED
+ png_debug(1, "in png_get_x_pixels_per_meter");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs) != 0)
- {
- png_debug1(1, "in %s retrieval function",
- "png_get_x_pixels_per_meter");
-
- if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)
- return (info_ptr->x_pixels_per_unit);
- }
+ {
+ if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)
+ return info_ptr->x_pixels_per_unit;
+ }
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
- return (0);
+ return 0;
}
png_uint_32 PNGAPI
@@ -149,42 +148,41 @@ png_get_y_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp
info_ptr)
{
#ifdef PNG_pHYs_SUPPORTED
+ png_debug(1, "in png_get_y_pixels_per_meter");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs) != 0)
{
- png_debug1(1, "in %s retrieval function",
- "png_get_y_pixels_per_meter");
-
if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER)
- return (info_ptr->y_pixels_per_unit);
+ return info_ptr->y_pixels_per_unit;
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
- return (0);
+ return 0;
}
png_uint_32 PNGAPI
png_get_pixels_per_meter(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
#ifdef PNG_pHYs_SUPPORTED
+ png_debug(1, "in png_get_pixels_per_meter");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs) != 0)
{
- png_debug1(1, "in %s retrieval function", "png_get_pixels_per_meter");
-
if (info_ptr->phys_unit_type == PNG_RESOLUTION_METER &&
info_ptr->x_pixels_per_unit == info_ptr->y_pixels_per_unit)
- return (info_ptr->x_pixels_per_unit);
+ return info_ptr->x_pixels_per_unit;
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
- return (0);
+ return 0;
}
#ifdef PNG_FLOATING_POINT_SUPPORTED
@@ -193,21 +191,21 @@ png_get_pixel_aspect_ratio(png_const_structrp png_ptr, png_const_inforp
info_ptr)
{
#ifdef PNG_READ_pHYs_SUPPORTED
+ png_debug(1, "in png_get_pixel_aspect_ratio");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs) != 0)
{
- png_debug1(1, "in %s retrieval function", "png_get_aspect_ratio");
-
if (info_ptr->x_pixels_per_unit != 0)
- return ((float)((float)info_ptr->y_pixels_per_unit
- /(float)info_ptr->x_pixels_per_unit));
+ return (float)info_ptr->y_pixels_per_unit
+ / (float)info_ptr->x_pixels_per_unit;
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
- return ((float)0.0);
+ return (float)0.0;
}
#endif
@@ -217,6 +215,8 @@ png_get_pixel_aspect_ratio_fixed(png_const_structrp png_ptr,
png_const_inforp info_ptr)
{
#ifdef PNG_READ_pHYs_SUPPORTED
+ png_debug(1, "in png_get_pixel_aspect_ratio_fixed");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs) != 0 &&
info_ptr->x_pixels_per_unit > 0 && info_ptr->y_pixels_per_unit > 0 &&
@@ -225,8 +225,6 @@ png_get_pixel_aspect_ratio_fixed(png_const_structrp png_ptr,
{
png_fixed_point res;
- png_debug1(1, "in %s retrieval function", "png_get_aspect_ratio_fixed");
-
/* The following casts work because a PNG 4 byte integer only has a valid
* range of 0..2^31-1; otherwise the cast might overflow.
*/
@@ -247,80 +245,80 @@ png_int_32 PNGAPI
png_get_x_offset_microns(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
#ifdef PNG_oFFs_SUPPORTED
+ png_debug(1, "in png_get_x_offset_microns");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_oFFs) != 0)
{
- png_debug1(1, "in %s retrieval function", "png_get_x_offset_microns");
-
if (info_ptr->offset_unit_type == PNG_OFFSET_MICROMETER)
- return (info_ptr->x_offset);
+ return info_ptr->x_offset;
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
- return (0);
+ return 0;
}
png_int_32 PNGAPI
png_get_y_offset_microns(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
#ifdef PNG_oFFs_SUPPORTED
+ png_debug(1, "in png_get_y_offset_microns");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_oFFs) != 0)
{
- png_debug1(1, "in %s retrieval function", "png_get_y_offset_microns");
-
if (info_ptr->offset_unit_type == PNG_OFFSET_MICROMETER)
- return (info_ptr->y_offset);
+ return info_ptr->y_offset;
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
- return (0);
+ return 0;
}
png_int_32 PNGAPI
png_get_x_offset_pixels(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
#ifdef PNG_oFFs_SUPPORTED
+ png_debug(1, "in png_get_x_offset_pixels");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_oFFs) != 0)
{
- png_debug1(1, "in %s retrieval function", "png_get_x_offset_pixels");
-
if (info_ptr->offset_unit_type == PNG_OFFSET_PIXEL)
- return (info_ptr->x_offset);
+ return info_ptr->x_offset;
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
- return (0);
+ return 0;
}
png_int_32 PNGAPI
png_get_y_offset_pixels(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
#ifdef PNG_oFFs_SUPPORTED
+ png_debug(1, "in png_get_y_offset_pixels");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_oFFs) != 0)
{
- png_debug1(1, "in %s retrieval function", "png_get_y_offset_pixels");
-
if (info_ptr->offset_unit_type == PNG_OFFSET_PIXEL)
- return (info_ptr->y_offset);
+ return info_ptr->y_offset;
}
#else
PNG_UNUSED(png_ptr)
PNG_UNUSED(info_ptr)
#endif
- return (0);
+ return 0;
}
#ifdef PNG_INCH_CONVERSIONS_SUPPORTED
@@ -434,11 +432,11 @@ png_get_pHYs_dpi(png_const_structrp png_ptr, png_const_inforp info_ptr,
{
png_uint_32 retval = 0;
+ png_debug1(1, "in %s retrieval function", "pHYs");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_pHYs) != 0)
{
- png_debug1(1, "in %s retrieval function", "pHYs");
-
if (res_x != NULL)
{
*res_x = info_ptr->x_pixels_per_unit;
@@ -464,7 +462,7 @@ png_get_pHYs_dpi(png_const_structrp png_ptr, png_const_inforp info_ptr,
}
}
- return (retval);
+ return retval;
}
#endif /* pHYs */
#endif /* INCH_CONVERSIONS */
@@ -478,9 +476,9 @@ png_byte PNGAPI
png_get_channels(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
- return(info_ptr->channels);
+ return info_ptr->channels;
- return (0);
+ return 0;
}
#ifdef PNG_READ_SUPPORTED
@@ -488,9 +486,9 @@ png_const_bytep PNGAPI
png_get_signature(png_const_structrp png_ptr, png_const_inforp info_ptr)
{
if (png_ptr != NULL && info_ptr != NULL)
- return(info_ptr->signature);
+ return info_ptr->signature;
- return (NULL);
+ return NULL;
}
#endif
@@ -499,17 +497,17 @@ png_uint_32 PNGAPI
png_get_bKGD(png_const_structrp png_ptr, png_inforp info_ptr,
png_color_16p *background)
{
+ png_debug1(1, "in %s retrieval function", "bKGD");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_bKGD) != 0 &&
background != NULL)
{
- png_debug1(1, "in %s retrieval function", "bKGD");
-
*background = &(info_ptr->background);
- return (PNG_INFO_bKGD);
+ return PNG_INFO_bKGD;
}
- return (0);
+ return 0;
}
#endif
@@ -524,6 +522,8 @@ png_get_cHRM(png_const_structrp png_ptr, png_const_inforp info_ptr,
double *white_x, double *white_y, double *red_x, double *red_y,
double *green_x, double *green_y, double *blue_x, double *blue_y)
{
+ png_debug1(1, "in %s retrieval function", "cHRM");
+
/* Quiet API change: this code used to only return the end points if a cHRM
* chunk was present, but the end points can also come from iCCP or sRGB
* chunks, so in 1.6.0 the png_get_ APIs return the end points regardless and
@@ -533,8 +533,6 @@ png_get_cHRM(png_const_structrp png_ptr, png_const_inforp info_ptr,
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
{
- png_debug1(1, "in %s retrieval function", "cHRM");
-
if (white_x != NULL)
*white_x = png_float(png_ptr,
info_ptr->colorspace.end_points_xy.whitex, "cHRM white X");
@@ -559,10 +557,10 @@ png_get_cHRM(png_const_structrp png_ptr, png_const_inforp info_ptr,
if (blue_y != NULL)
*blue_y = png_float(png_ptr, info_ptr->colorspace.end_points_xy.bluey,
"cHRM blue Y");
- return (PNG_INFO_cHRM);
+ return PNG_INFO_cHRM;
}
- return (0);
+ return 0;
}
png_uint_32 PNGAPI
@@ -571,11 +569,11 @@ png_get_cHRM_XYZ(png_const_structrp png_ptr, png_const_inforp info_ptr,
double *green_Y, double *green_Z, double *blue_X, double *blue_Y,
double *blue_Z)
{
+ png_debug1(1, "in %s retrieval function", "cHRM_XYZ(float)");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
{
- png_debug1(1, "in %s retrieval function", "cHRM_XYZ(float)");
-
if (red_X != NULL)
*red_X = png_float(png_ptr, info_ptr->colorspace.end_points_XYZ.red_X,
"cHRM red X");
@@ -603,10 +601,10 @@ png_get_cHRM_XYZ(png_const_structrp png_ptr, png_const_inforp info_ptr,
if (blue_Z != NULL)
*blue_Z = png_float(png_ptr,
info_ptr->colorspace.end_points_XYZ.blue_Z, "cHRM blue Z");
- return (PNG_INFO_cHRM);
+ return PNG_INFO_cHRM;
}
- return (0);
+ return 0;
}
# endif
@@ -619,11 +617,11 @@ png_get_cHRM_XYZ_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
png_fixed_point *int_blue_X, png_fixed_point *int_blue_Y,
png_fixed_point *int_blue_Z)
{
+ png_debug1(1, "in %s retrieval function", "cHRM_XYZ");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->colorspace.flags & PNG_COLORSPACE_HAVE_ENDPOINTS) != 0)
{
- png_debug1(1, "in %s retrieval function", "cHRM_XYZ");
-
if (int_red_X != NULL)
*int_red_X = info_ptr->colorspace.end_points_XYZ.red_X;
if (int_red_Y != NULL)
@@ -642,10 +640,10 @@ png_get_cHRM_XYZ_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
*int_blue_Y = info_ptr->colorspace.end_points_XYZ.blue_Y;
if (int_blue_Z != NULL)
*int_blue_Z = info_ptr->colorspace.end_points_XYZ.blue_Z;
- return (PNG_INFO_cHRM);
+ return PNG_INFO_cHRM;
}
- return (0);
+ return 0;
}
png_uint_32 PNGAPI
@@ -675,10 +673,10 @@ png_get_cHRM_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
*blue_x = info_ptr->colorspace.end_points_xy.bluex;
if (blue_y != NULL)
*blue_y = info_ptr->colorspace.end_points_xy.bluey;
- return (PNG_INFO_cHRM);
+ return PNG_INFO_cHRM;
}
- return (0);
+ return 0;
}
# endif
#endif
@@ -696,10 +694,10 @@ png_get_gAMA_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
file_gamma != NULL)
{
*file_gamma = info_ptr->colorspace.gamma;
- return (PNG_INFO_gAMA);
+ return PNG_INFO_gAMA;
}
- return (0);
+ return 0;
}
# endif
@@ -716,10 +714,10 @@ png_get_gAMA(png_const_structrp png_ptr, png_const_inforp info_ptr,
{
*file_gamma = png_float(png_ptr, info_ptr->colorspace.gamma,
"png_get_gAMA");
- return (PNG_INFO_gAMA);
+ return PNG_INFO_gAMA;
}
- return (0);
+ return 0;
}
# endif
#endif
@@ -735,10 +733,10 @@ png_get_sRGB(png_const_structrp png_ptr, png_const_inforp info_ptr,
(info_ptr->valid & PNG_INFO_sRGB) != 0 && file_srgb_intent != NULL)
{
*file_srgb_intent = info_ptr->colorspace.rendering_intent;
- return (PNG_INFO_sRGB);
+ return PNG_INFO_sRGB;
}
- return (0);
+ return 0;
}
#endif
@@ -762,10 +760,10 @@ png_get_iCCP(png_const_structrp png_ptr, png_inforp info_ptr,
*/
if (compression_type != NULL)
*compression_type = PNG_COMPRESSION_TYPE_BASE;
- return (PNG_INFO_iCCP);
+ return PNG_INFO_iCCP;
}
- return (0);
+ return 0;
}
#endif
@@ -775,13 +773,15 @@ int PNGAPI
png_get_sPLT(png_const_structrp png_ptr, png_inforp info_ptr,
png_sPLT_tpp spalettes)
{
+ png_debug1(1, "in %s retrieval function", "sPLT");
+
if (png_ptr != NULL && info_ptr != NULL && spalettes != NULL)
{
*spalettes = info_ptr->splt_palettes;
return info_ptr->splt_palettes_num;
}
- return (0);
+ return 0;
}
#endif
@@ -807,10 +807,10 @@ png_get_eXIf_1(png_const_structrp png_ptr, png_const_inforp info_ptr,
{
*num_exif = info_ptr->num_exif;
*exif = info_ptr->exif;
- return (PNG_INFO_eXIf);
+ return PNG_INFO_eXIf;
}
- return (0);
+ return 0;
}
#endif
@@ -825,10 +825,10 @@ png_get_hIST(png_const_structrp png_ptr, png_inforp info_ptr,
(info_ptr->valid & PNG_INFO_hIST) != 0 && hist != NULL)
{
*hist = info_ptr->hist;
- return (PNG_INFO_hIST);
+ return PNG_INFO_hIST;
}
- return (0);
+ return 0;
}
#endif
@@ -841,7 +841,7 @@ png_get_IHDR(png_const_structrp png_ptr, png_const_inforp info_ptr,
png_debug1(1, "in %s retrieval function", "IHDR");
if (png_ptr == NULL || info_ptr == NULL)
- return (0);
+ return 0;
if (width != NULL)
*width = info_ptr->width;
@@ -873,7 +873,7 @@ png_get_IHDR(png_const_structrp png_ptr, png_const_inforp info_ptr,
info_ptr->bit_depth, info_ptr->color_type, info_ptr->interlace_type,
info_ptr->compression_type, info_ptr->filter_type);
- return (1);
+ return 1;
}
#ifdef PNG_oFFs_SUPPORTED
@@ -890,10 +890,10 @@ png_get_oFFs(png_const_structrp png_ptr, png_const_inforp info_ptr,
*offset_x = info_ptr->x_offset;
*offset_y = info_ptr->y_offset;
*unit_type = (int)info_ptr->offset_unit_type;
- return (PNG_INFO_oFFs);
+ return PNG_INFO_oFFs;
}
- return (0);
+ return 0;
}
#endif
@@ -917,10 +917,10 @@ png_get_pCAL(png_const_structrp png_ptr, png_inforp info_ptr,
*nparams = (int)info_ptr->pcal_nparams;
*units = info_ptr->pcal_units;
*params = info_ptr->pcal_params;
- return (PNG_INFO_pCAL);
+ return PNG_INFO_pCAL;
}
- return (0);
+ return 0;
}
#endif
@@ -932,6 +932,8 @@ png_uint_32 PNGAPI
png_get_sCAL_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
int *unit, png_fixed_point *width, png_fixed_point *height)
{
+ png_debug1(1, "in %s retrieval function", "sCAL");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_sCAL) != 0)
{
@@ -943,10 +945,10 @@ png_get_sCAL_fixed(png_const_structrp png_ptr, png_const_inforp info_ptr,
*width = png_fixed(png_ptr, atof(info_ptr->scal_s_width), "sCAL width");
*height = png_fixed(png_ptr, atof(info_ptr->scal_s_height),
"sCAL height");
- return (PNG_INFO_sCAL);
+ return PNG_INFO_sCAL;
}
- return(0);
+ return 0;
}
# endif /* FLOATING_ARITHMETIC */
# endif /* FIXED_POINT */
@@ -955,32 +957,36 @@ png_uint_32 PNGAPI
png_get_sCAL(png_const_structrp png_ptr, png_const_inforp info_ptr,
int *unit, double *width, double *height)
{
+ png_debug1(1, "in %s retrieval function", "sCAL(float)");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_sCAL) != 0)
{
*unit = info_ptr->scal_unit;
*width = atof(info_ptr->scal_s_width);
*height = atof(info_ptr->scal_s_height);
- return (PNG_INFO_sCAL);
+ return PNG_INFO_sCAL;
}
- return(0);
+ return 0;
}
# endif /* FLOATING POINT */
png_uint_32 PNGAPI
png_get_sCAL_s(png_const_structrp png_ptr, png_const_inforp info_ptr,
int *unit, png_charpp width, png_charpp height)
{
+ png_debug1(1, "in %s retrieval function", "sCAL(str)");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_sCAL) != 0)
{
*unit = info_ptr->scal_unit;
*width = info_ptr->scal_s_width;
*height = info_ptr->scal_s_height;
- return (PNG_INFO_sCAL);
+ return PNG_INFO_sCAL;
}
- return(0);
+ return 0;
}
#endif /* sCAL */
@@ -1015,7 +1021,7 @@ png_get_pHYs(png_const_structrp png_ptr, png_const_inforp info_ptr,
}
}
- return (retval);
+ return retval;
}
#endif /* pHYs */
@@ -1031,10 +1037,10 @@ png_get_PLTE(png_const_structrp png_ptr, png_inforp info_ptr,
*palette = info_ptr->palette;
*num_palette = info_ptr->num_palette;
png_debug1(3, "num_palette = %d", *num_palette);
- return (PNG_INFO_PLTE);
+ return PNG_INFO_PLTE;
}
- return (0);
+ return 0;
}
#ifdef PNG_sBIT_SUPPORTED
@@ -1048,10 +1054,10 @@ png_get_sBIT(png_const_structrp png_ptr, png_inforp info_ptr,
(info_ptr->valid & PNG_INFO_sBIT) != 0 && sig_bit != NULL)
{
*sig_bit = &(info_ptr->sig_bit);
- return (PNG_INFO_sBIT);
+ return PNG_INFO_sBIT;
}
- return (0);
+ return 0;
}
#endif
@@ -1062,7 +1068,7 @@ png_get_text(png_const_structrp png_ptr, png_inforp info_ptr,
{
if (png_ptr != NULL && info_ptr != NULL && info_ptr->num_text > 0)
{
- png_debug1(1, "in 0x%lx retrieval function",
+ png_debug1(1, "in text retrieval function, chunk typeid = 0x%lx",
(unsigned long)png_ptr->chunk_name);
if (text_ptr != NULL)
@@ -1077,7 +1083,7 @@ png_get_text(png_const_structrp png_ptr, png_inforp info_ptr,
if (num_text != NULL)
*num_text = 0;
- return(0);
+ return 0;
}
#endif
@@ -1092,10 +1098,10 @@ png_get_tIME(png_const_structrp png_ptr, png_inforp info_ptr,
(info_ptr->valid & PNG_INFO_tIME) != 0 && mod_time != NULL)
{
*mod_time = &(info_ptr->mod_time);
- return (PNG_INFO_tIME);
+ return PNG_INFO_tIME;
}
- return (0);
+ return 0;
}
#endif
@@ -1105,11 +1111,12 @@ png_get_tRNS(png_const_structrp png_ptr, png_inforp info_ptr,
png_bytep *trans_alpha, int *num_trans, png_color_16p *trans_color)
{
png_uint_32 retval = 0;
+
+ png_debug1(1, "in %s retrieval function", "tRNS");
+
if (png_ptr != NULL && info_ptr != NULL &&
(info_ptr->valid & PNG_INFO_tRNS) != 0)
{
- png_debug1(1, "in %s retrieval function", "tRNS");
-
if (info_ptr->color_type == PNG_COLOR_TYPE_PALETTE)
{
if (trans_alpha != NULL)
@@ -1141,7 +1148,7 @@ png_get_tRNS(png_const_structrp png_ptr, png_inforp info_ptr,
}
}
- return (retval);
+ return retval;
}
#endif
@@ -1156,7 +1163,7 @@ png_get_unknown_chunks(png_const_structrp png_ptr, png_inforp info_ptr,
return info_ptr->unknown_chunks_num;
}
- return (0);
+ return 0;
}
#endif
@@ -1252,7 +1259,7 @@ png_get_palette_max(png_const_structp png_ptr, png_const_infop info_ptr)
if (png_ptr != NULL && info_ptr != NULL)
return png_ptr->num_palette_max;
- return (-1);
+ return -1;
}
# endif
#endif
diff --git a/contrib/libs/libpng/pnglibconf.h b/contrib/libs/libpng/pnglibconf.h
index a880e4c5ef..5bd9b122af 100644
--- a/contrib/libs/libpng/pnglibconf.h
+++ b/contrib/libs/libpng/pnglibconf.h
@@ -1,8 +1,8 @@
/* pnglibconf.h - library build configuration */
-/* libpng version 1.6.40 */
+/* libpng version 1.6.44 */
-/* Copyright (c) 2018-2023 Cosmin Truta */
+/* Copyright (c) 2018-2024 Cosmin Truta */
/* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */
/* This code is released under the libpng license. */
@@ -27,6 +27,7 @@
#define PNG_COLORSPACE_SUPPORTED
#define PNG_CONSOLE_IO_SUPPORTED
#define PNG_CONVERT_tIME_SUPPORTED
+/*#undef PNG_DISABLE_ADLER32_CHECK_SUPPORTED*/
#define PNG_EASY_ACCESS_SUPPORTED
/*#undef PNG_ERROR_NUMBERS_SUPPORTED*/
#define PNG_ERROR_TEXT_SUPPORTED
@@ -41,6 +42,10 @@
#define PNG_INCH_CONVERSIONS_SUPPORTED
#define PNG_INFO_IMAGE_SUPPORTED
#define PNG_IO_STATE_SUPPORTED
+/*#undef PNG_MIPS_MMI_API_SUPPORTED*/
+/*#undef PNG_MIPS_MMI_CHECK_SUPPORTED*/
+/*#undef PNG_MIPS_MSA_API_SUPPORTED*/
+/*#undef PNG_MIPS_MSA_CHECK_SUPPORTED*/
#define PNG_MNG_FEATURES_SUPPORTED
#define PNG_POINTER_INDEXING_SUPPORTED
/*#undef PNG_POWERPC_VSX_API_SUPPORTED*/
diff --git a/contrib/libs/libpng/pngpread.c b/contrib/libs/libpng/pngpread.c
index 7d452a76f2..826d879cb2 100644
--- a/contrib/libs/libpng/pngpread.c
+++ b/contrib/libs/libpng/pngpread.c
@@ -1,7 +1,7 @@
/* pngpread.c - read a png file in push mode
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
@@ -145,10 +145,10 @@ png_push_read_sig(png_structrp png_ptr, png_inforp info_ptr)
num_to_check);
png_ptr->sig_bytes = (png_byte)(png_ptr->sig_bytes + num_to_check);
- if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check))
+ if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check) != 0)
{
if (num_checked < 4 &&
- png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4))
+ png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4) != 0)
png_error(png_ptr, "Not a PNG file");
else
@@ -381,6 +381,14 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr)
}
#endif
+#ifdef PNG_READ_eXIf_SUPPORTED
+ else if (png_ptr->chunk_name == png_eXIf)
+ {
+ PNG_PUSH_SAVE_BUFFER_IF_FULL
+ png_handle_eXIf(png_ptr, info_ptr, png_ptr->push_length);
+ }
+
+#endif
#ifdef PNG_READ_sRGB_SUPPORTED
else if (chunk_name == png_sRGB)
{
@@ -1258,7 +1266,7 @@ png_voidp PNGAPI
png_get_progressive_ptr(png_const_structrp png_ptr)
{
if (png_ptr == NULL)
- return (NULL);
+ return NULL;
return png_ptr->io_ptr;
}
diff --git a/contrib/libs/libpng/pngpriv.h b/contrib/libs/libpng/pngpriv.h
index b48ba2ebc8..eccafd8d2d 100644
--- a/contrib/libs/libpng/pngpriv.h
+++ b/contrib/libs/libpng/pngpriv.h
@@ -1,7 +1,7 @@
/* pngpriv.h - private declarations for use inside libpng
*
- * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
@@ -36,7 +36,7 @@
* still required (as of 2011-05-02.)
*/
#ifndef _POSIX_SOURCE
-# define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
+# define _POSIX_SOURCE 1 /* Just the POSIX 1003.1 and C89 APIs */
#endif
#ifndef PNG_VERSION_INFO_ONLY
@@ -140,47 +140,6 @@
* callbacks to do this.
*/
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_neon
-
- /* By default the 'intrinsics' code in arm/filter_neon_intrinsics.c is used
- * if possible - if __ARM_NEON__ is set and the compiler version is not known
- * to be broken. This is controlled by PNG_ARM_NEON_IMPLEMENTATION which can
- * be:
- *
- * 1 The intrinsics code (the default with __ARM_NEON__)
- * 2 The hand coded assembler (the default without __ARM_NEON__)
- *
- * It is possible to set PNG_ARM_NEON_IMPLEMENTATION in CPPFLAGS, however
- * this is *NOT* supported and may cease to work even after a minor revision
- * to libpng. It *is* valid to do this for testing purposes, e.g. speed
- * testing or a new compiler, but the results should be communicated to the
- * libpng implementation list for incorporation in the next minor release.
- */
-# ifndef PNG_ARM_NEON_IMPLEMENTATION
-# if defined(__ARM_NEON__) || defined(__ARM_NEON)
-# if defined(__clang__)
- /* At present it is unknown by the libpng developers which versions
- * of clang support the intrinsics, however some or perhaps all
- * versions do not work with the assembler so this may be
- * irrelevant, so just use the default (do nothing here.)
- */
-# elif defined(__GNUC__)
- /* GCC 4.5.4 NEON support is known to be broken. 4.6.3 is known to
- * work, so if this *is* GCC, or G++, look for a version >4.5
- */
-# if __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 6)
-# define PNG_ARM_NEON_IMPLEMENTATION 2
-# endif /* no GNUC support */
-# endif /* __GNUC__ */
-# else /* !defined __ARM_NEON__ */
- /* The 'intrinsics' code simply won't compile without this -mfpu=neon:
- */
-# if !defined(__aarch64__) && !defined(_M_ARM64)
- /* The assembler code currently does not work on ARM64 */
-# define PNG_ARM_NEON_IMPLEMENTATION 2
-# endif /* __aarch64__ */
-# endif /* __ARM_NEON__ */
-# endif /* !PNG_ARM_NEON_IMPLEMENTATION */
-
# ifndef PNG_ARM_NEON_IMPLEMENTATION
/* Use the intrinsics code by default. */
# define PNG_ARM_NEON_IMPLEMENTATION 1
@@ -190,13 +149,27 @@
#endif /* PNG_ARM_NEON_OPT > 0 */
#ifndef PNG_MIPS_MSA_OPT
-# if defined(__mips_msa) && (__mips_isa_rev >= 5) && defined(PNG_ALIGNED_MEMORY_SUPPORTED)
+# if defined(__mips_msa) && (__mips_isa_rev >= 5) && \
+ defined(PNG_ALIGNED_MEMORY_SUPPORTED)
# define PNG_MIPS_MSA_OPT 2
# else
# define PNG_MIPS_MSA_OPT 0
# endif
#endif
+#ifndef PNG_MIPS_MMI_OPT
+# ifdef PNG_MIPS_MMI
+# if defined(__mips_loongson_mmi) && (_MIPS_SIM == _ABI64) && \
+ defined(PNG_ALIGNED_MEMORY_SUPPORTED)
+# define PNG_MIPS_MMI_OPT 1
+# else
+# define PNG_MIPS_MMI_OPT 0
+# endif
+# else
+# define PNG_MIPS_MMI_OPT 0
+# endif
+#endif
+
#ifndef PNG_POWERPC_VSX_OPT
# if defined(__PPC64__) && defined(__ALTIVEC__) && defined(__VSX__)
# define PNG_POWERPC_VSX_OPT 2
@@ -205,13 +178,21 @@
# endif
#endif
+#ifndef PNG_LOONGARCH_LSX_OPT
+# if defined(__loongarch_sx)
+# define PNG_LOONGARCH_LSX_OPT 1
+# else
+# define PNG_LOONGARCH_LSX_OPT 0
+# endif
+#endif
+
#ifndef PNG_INTEL_SSE_OPT
# ifdef PNG_INTEL_SSE
/* Only check for SSE if the build configuration has been modified to
* enable SSE optimizations. This means that these optimizations will
* be off by default. See contrib/intel for more details.
*/
-# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
+# if defined(__SSE4_1__) || defined(__AVX__) || defined(__SSSE3__) || \
defined(__SSE2__) || defined(_M_X64) || defined(_M_AMD64) || \
(defined(_M_IX86_FP) && _M_IX86_FP >= 2)
# define PNG_INTEL_SSE_OPT 1
@@ -248,7 +229,6 @@
#endif
#if PNG_MIPS_MSA_OPT > 0
-# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_msa
# ifndef PNG_MIPS_MSA_IMPLEMENTATION
# if defined(__mips_msa)
# if defined(__clang__)
@@ -264,11 +244,28 @@
# ifndef PNG_MIPS_MSA_IMPLEMENTATION
# define PNG_MIPS_MSA_IMPLEMENTATION 1
+# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_mips
# endif
#else
# define PNG_MIPS_MSA_IMPLEMENTATION 0
#endif /* PNG_MIPS_MSA_OPT > 0 */
+#if PNG_MIPS_MMI_OPT > 0
+# ifndef PNG_MIPS_MMI_IMPLEMENTATION
+# if defined(__mips_loongson_mmi) && (_MIPS_SIM == _ABI64)
+# define PNG_MIPS_MMI_IMPLEMENTATION 2
+# else /* !defined __mips_loongson_mmi || _MIPS_SIM != _ABI64 */
+# define PNG_MIPS_MMI_IMPLEMENTATION 0
+# endif /* __mips_loongson_mmi && _MIPS_SIM == _ABI64 */
+# endif /* !PNG_MIPS_MMI_IMPLEMENTATION */
+
+# if PNG_MIPS_MMI_IMPLEMENTATION > 0
+# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_mips
+# endif
+#else
+# define PNG_MIPS_MMI_IMPLEMENTATION 0
+#endif /* PNG_MIPS_MMI_OPT > 0 */
+
#if PNG_POWERPC_VSX_OPT > 0
# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_vsx
# define PNG_POWERPC_VSX_IMPLEMENTATION 1
@@ -276,6 +273,12 @@
# define PNG_POWERPC_VSX_IMPLEMENTATION 0
#endif
+#if PNG_LOONGARCH_LSX_OPT > 0
+# define PNG_FILTER_OPTIMIZATIONS png_init_filter_functions_lsx
+# define PNG_LOONGARCH_LSX_IMPLEMENTATION 1
+#else
+# define PNG_LOONGARCH_LSX_IMPLEMENTATION 0
+#endif
/* Is this a build of a DLL where compilation of the object modules requires
* different preprocessor settings to those required for a simple library? If
@@ -514,23 +517,8 @@
*/
# include <float.h>
-#if defined(__clang__) && __clang_major__ >= 17
-#include <math.h>
-#define __MATH_H__
-#endif
+# include <math.h>
-# if (defined(__MWERKS__) && defined(macintosh)) || defined(applec) || \
- defined(THINK_C) || defined(__SC__) || defined(TARGET_OS_MAC)
- /* We need to check that <math.h> hasn't already been included earlier
- * as it seems it doesn't agree with <fp.h>, yet we should really use
- * <fp.h> if possible.
- */
-# if !defined(__MATH_H__) && !defined(__MATH_H) && !defined(__cmath__)
-# include <fp.h>
-# endif
-# else
-# include <math.h>
-# endif
# if defined(_AMIGA) && defined(__SASC) && defined(_M68881)
/* Amiga SAS/C: We must include builtin FPU functions when compiling using
* MATH=68881
@@ -1325,7 +1313,7 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
-#if PNG_MIPS_MSA_OPT > 0
+#if PNG_MIPS_MSA_IMPLEMENTATION == 1
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_msa,(png_row_infop row_info,
png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_msa,(png_row_infop
@@ -1342,6 +1330,23 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_msa,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
+#if PNG_MIPS_MMI_IMPLEMENTATION > 0
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_mmi,(png_row_infop row_info,
+ png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_mmi,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_mmi,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_mmi,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_mmi,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_mmi,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_mmi,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+#endif
+
#if PNG_POWERPC_VSX_OPT > 0
PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_vsx,(png_row_infop row_info,
png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
@@ -1374,6 +1379,23 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_sse2,(png_row_infop
row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
#endif
+#if PNG_LOONGARCH_LSX_IMPLEMENTATION == 1
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_up_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub3_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_sub4_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg3_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_avg4_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_lsx,(png_row_infop
+ row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY);
+#endif
+
/* Choose the best filter to use and filter the row data */
PNG_INTERNAL_FUNCTION(void,png_write_find_filter,(png_structrp png_ptr,
png_row_infop row_info),PNG_EMPTY);
@@ -2156,17 +2178,27 @@ PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_neon,
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif
-#if PNG_MIPS_MSA_OPT > 0
-PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_msa,
+#if PNG_MIPS_MSA_IMPLEMENTATION == 1
+PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_mips,
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
#endif
+# if PNG_MIPS_MMI_IMPLEMENTATION > 0
+PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_mips,
+ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
+# endif
+
# if PNG_INTEL_SSE_IMPLEMENTATION > 0
PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_sse2,
(png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
# endif
#endif
+#if PNG_LOONGARCH_LSX_OPT > 0
+PNG_INTERNAL_FUNCTION(void, png_init_filter_functions_lsx,
+ (png_structp png_ptr, unsigned int bpp), PNG_EMPTY);
+#endif
+
PNG_INTERNAL_FUNCTION(png_uint_32, png_check_keyword, (png_structrp png_ptr,
png_const_charp key, png_bytep new_key), PNG_EMPTY);
diff --git a/contrib/libs/libpng/pngread.c b/contrib/libs/libpng/pngread.c
index 9061dfbc43..26c8d00ecc 100644
--- a/contrib/libs/libpng/pngread.c
+++ b/contrib/libs/libpng/pngread.c
@@ -1,7 +1,7 @@
/* pngread.c - read a PNG file
*
- * Copyright (c) 2018-2019 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
@@ -648,7 +648,11 @@ png_read_row(png_structrp png_ptr, png_bytep row, png_bytep dsp_row)
#endif
#ifdef PNG_READ_TRANSFORMS_SUPPORTED
- if (png_ptr->transformations)
+ if (png_ptr->transformations
+# ifdef PNG_CHECK_FOR_INVALID_INDEX_SUPPORTED
+ || png_ptr->num_palette_max >= 0
+# endif
+ )
png_do_read_transformations(png_ptr, &row_info);
#endif
@@ -865,7 +869,7 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr)
#ifdef PNG_READ_CHECK_FOR_INVALID_INDEX_SUPPORTED
/* Report invalid palette index; added at libng-1.5.10 */
if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
- png_ptr->num_palette_max > png_ptr->num_palette)
+ png_ptr->num_palette_max >= png_ptr->num_palette)
png_benign_error(png_ptr, "Read palette index exceeding num_palette");
#endif
@@ -1129,6 +1133,8 @@ void PNGAPI
png_read_png(png_structrp png_ptr, png_inforp info_ptr,
int transforms, voidp params)
{
+ png_debug(1, "in png_read_png");
+
if (png_ptr == NULL || info_ptr == NULL)
return;
diff --git a/contrib/libs/libpng/pngrtran.c b/contrib/libs/libpng/pngrtran.c
index 238f5afe7e..1526123e02 100644
--- a/contrib/libs/libpng/pngrtran.c
+++ b/contrib/libs/libpng/pngrtran.c
@@ -1,7 +1,7 @@
/* pngrtran.c - transforms the data in a row for PNG readers
*
- * Copyright (c) 2018-2019 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
@@ -290,21 +290,20 @@ png_set_alpha_mode_fixed(png_structrp png_ptr, int mode,
int compose = 0;
png_fixed_point file_gamma;
- png_debug(1, "in png_set_alpha_mode");
+ png_debug(1, "in png_set_alpha_mode_fixed");
if (png_rtran_ok(png_ptr, 0) == 0)
return;
output_gamma = translate_gamma_flags(png_ptr, output_gamma, 1/*screen*/);
- /* Validate the value to ensure it is in a reasonable range. The value
+ /* Validate the value to ensure it is in a reasonable range. The value
* is expected to be 1 or greater, but this range test allows for some
- * viewing correction values. The intent is to weed out users of this API
- * who use the inverse of the gamma value accidentally! Since some of these
- * values are reasonable this may have to be changed:
+ * viewing correction values. The intent is to weed out the API users
+ * who might use the inverse of the gamma value accidentally!
*
- * 1.6.x: changed from 0.07..3 to 0.01..100 (to accommodate the optimal 16-bit
- * gamma of 36, and its reciprocal.)
+ * In libpng 1.6.0, we changed from 0.07..3 to 0.01..100, to accommodate
+ * the optimal 16-bit gamma of 36 and its reciprocal.
*/
if (output_gamma < 1000 || output_gamma > 10000000)
png_error(png_ptr, "output gamma out of expected range");
@@ -441,7 +440,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
int i;
png_ptr->quantize_index = (png_bytep)png_malloc(png_ptr,
- (png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
+ (png_alloc_size_t)num_palette);
for (i = 0; i < num_palette; i++)
png_ptr->quantize_index[i] = (png_byte)i;
}
@@ -458,7 +457,7 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
/* Initialize an array to sort colors */
png_ptr->quantize_sort = (png_bytep)png_malloc(png_ptr,
- (png_alloc_size_t)((png_uint_32)num_palette * (sizeof (png_byte))));
+ (png_alloc_size_t)num_palette);
/* Initialize the quantize_sort array */
for (i = 0; i < num_palette; i++)
@@ -592,11 +591,9 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
/* Initialize palette index arrays */
png_ptr->index_to_palette = (png_bytep)png_malloc(png_ptr,
- (png_alloc_size_t)((png_uint_32)num_palette *
- (sizeof (png_byte))));
+ (png_alloc_size_t)num_palette);
png_ptr->palette_to_index = (png_bytep)png_malloc(png_ptr,
- (png_alloc_size_t)((png_uint_32)num_palette *
- (sizeof (png_byte))));
+ (png_alloc_size_t)num_palette);
/* Initialize the sort array */
for (i = 0; i < num_palette; i++)
@@ -761,12 +758,11 @@ png_set_quantize(png_structrp png_ptr, png_colorp palette,
size_t num_entries = ((size_t)1 << total_bits);
png_ptr->palette_lookup = (png_bytep)png_calloc(png_ptr,
- (png_alloc_size_t)(num_entries * (sizeof (png_byte))));
+ (png_alloc_size_t)(num_entries));
- distance = (png_bytep)png_malloc(png_ptr, (png_alloc_size_t)(num_entries *
- (sizeof (png_byte))));
+ distance = (png_bytep)png_malloc(png_ptr, (png_alloc_size_t)num_entries);
- memset(distance, 0xff, num_entries * (sizeof (png_byte)));
+ memset(distance, 0xff, num_entries);
for (i = 0; i < num_palette; i++)
{
@@ -970,7 +966,7 @@ void PNGFAPI
png_set_rgb_to_gray_fixed(png_structrp png_ptr, int error_action,
png_fixed_point red, png_fixed_point green)
{
- png_debug(1, "in png_set_rgb_to_gray");
+ png_debug(1, "in png_set_rgb_to_gray_fixed");
/* Need the IHDR here because of the check on color_type below. */
/* TODO: fix this */
diff --git a/contrib/libs/libpng/pngrutil.c b/contrib/libs/libpng/pngrutil.c
index 737aa99e3b..a4f5eb1eb6 100644
--- a/contrib/libs/libpng/pngrutil.c
+++ b/contrib/libs/libpng/pngrutil.c
@@ -1,7 +1,7 @@
/* pngrutil.c - utilities to read a PNG file
*
- * Copyright (c) 2018-2022 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
@@ -26,7 +26,7 @@ png_get_uint_31(png_const_structrp png_ptr, png_const_bytep buf)
if (uval > PNG_UINT_31_MAX)
png_error(png_ptr, "PNG unsigned integer out of range");
- return (uval);
+ return uval;
}
#if defined(PNG_READ_gAMA_SUPPORTED) || defined(PNG_READ_cHRM_SUPPORTED)
@@ -140,7 +140,7 @@ png_read_sig(png_structrp png_ptr, png_inforp info_ptr)
if (png_sig_cmp(info_ptr->signature, num_checked, num_to_check) != 0)
{
if (num_checked < 4 &&
- png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4))
+ png_sig_cmp(info_ptr->signature, num_checked, num_to_check - 4) != 0)
png_error(png_ptr, "Not a PNG file");
else
png_error(png_ptr, "PNG file corrupted by ASCII conversion");
@@ -171,7 +171,7 @@ png_read_chunk_header(png_structrp png_ptr)
/* Put the chunk name into png_ptr->chunk_name. */
png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(buf+4);
- png_debug2(0, "Reading %lx chunk, length = %lu",
+ png_debug2(0, "Reading chunk typeid = 0x%lx, length = %lu",
(unsigned long)png_ptr->chunk_name, (unsigned long)length);
/* Reset the crc and run it over the chunk name. */
@@ -238,10 +238,10 @@ png_crc_finish(png_structrp png_ptr, png_uint_32 skip)
else
png_chunk_error(png_ptr, "CRC error");
- return (1);
+ return 1;
}
- return (0);
+ return 0;
}
/* Compare the CRC stored in the PNG file with that calculated by libpng from
@@ -277,11 +277,11 @@ png_crc_error(png_structrp png_ptr)
if (need_crc != 0)
{
crc = png_get_uint_32(crc_bytes);
- return ((int)(crc != png_ptr->crc));
+ return crc != png_ptr->crc;
}
else
- return (0);
+ return 0;
}
#if defined(PNG_READ_iCCP_SUPPORTED) || defined(PNG_READ_iTXt_SUPPORTED) ||\
@@ -421,8 +421,7 @@ png_inflate_claim(png_structrp png_ptr, png_uint_32 owner)
png_ptr->flags |= PNG_FLAG_ZSTREAM_INITIALIZED;
}
-#if ZLIB_VERNUM >= 0x1290 && \
- defined(PNG_SET_OPTION_SUPPORTED) && defined(PNG_IGNORE_ADLER32)
+#ifdef PNG_DISABLE_ADLER32_CHECK_SUPPORTED
if (((png_ptr->options >> PNG_IGNORE_ADLER32) & 3) == PNG_OPTION_ON)
/* Turn off validation of the ADLER32 checksum in IDAT chunks */
ret = inflateValidate(&png_ptr->zstream, 0);
diff --git a/contrib/libs/libpng/pngset.c b/contrib/libs/libpng/pngset.c
index b0e8998d81..b29cd6181d 100644
--- a/contrib/libs/libpng/pngset.c
+++ b/contrib/libs/libpng/pngset.c
@@ -1,7 +1,7 @@
/* pngset.c - storage of image information into info struct
*
- * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 2018-2024 Cosmin Truta
* Copyright (c) 1998-2018 Glenn Randers-Pehrson
* Copyright (c) 1996-1997 Andreas Dilger
* Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc.
@@ -768,11 +768,11 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr,
{
int i;
- png_debug1(1, "in %lx storage function", png_ptr == NULL ? 0xabadca11U :
- (unsigned long)png_ptr->chunk_name);
+ png_debug1(1, "in text storage function, chunk typeid = 0x%lx",
+ png_ptr == NULL ? 0xabadca11UL : (unsigned long)png_ptr->chunk_name);
if (png_ptr == NULL || info_ptr == NULL || num_text <= 0 || text_ptr == NULL)
- return(0);
+ return 0;
/* Make sure we have enough space in the "text" array in info_struct
* to hold all of the incoming text_ptr objects. This compare can't overflow
@@ -952,7 +952,7 @@ png_set_text_2(png_const_structrp png_ptr, png_inforp info_ptr,
png_debug1(3, "transferred text chunk %d", info_ptr->num_text);
}
- return(0);
+ return 0;
}
#endif
@@ -1068,6 +1068,8 @@ png_set_sPLT(png_const_structrp png_ptr,
{
png_sPLT_tp np;
+ png_debug1(1, "in %s storage function", "sPLT");
+
if (png_ptr == NULL || info_ptr == NULL || nentries <= 0 || entries == NULL)
return;
@@ -1682,7 +1684,7 @@ void PNGAPI
png_set_rows(png_const_structrp png_ptr, png_inforp info_ptr,
png_bytepp row_pointers)
{
- png_debug1(1, "in %s storage function", "rows");
+ png_debug(1, "in png_set_rows");
if (png_ptr == NULL || info_ptr == NULL)
return;
@@ -1701,6 +1703,8 @@ png_set_rows(png_const_structrp png_ptr, png_inforp info_ptr,
void PNGAPI
png_set_compression_buffer_size(png_structrp png_ptr, size_t size)
{
+ png_debug(1, "in png_set_compression_buffer_size");
+
if (png_ptr == NULL)
return;
@@ -1772,6 +1776,8 @@ void PNGAPI
png_set_user_limits(png_structrp png_ptr, png_uint_32 user_width_max,
png_uint_32 user_height_max)
{
+ png_debug(1, "in png_set_user_limits");
+
/* Images with dimensions larger than these limits will be
* rejected by png_set_IHDR(). To accept any PNG datastream
* regardless of dimensions, set both limits to 0x7fffffff.
@@ -1787,6 +1793,8 @@ png_set_user_limits(png_structrp png_ptr, png_uint_32 user_width_max,
void PNGAPI
png_set_chunk_cache_max(png_structrp png_ptr, png_uint_32 user_chunk_cache_max)
{
+ png_debug(1, "in png_set_chunk_cache_max");
+
if (png_ptr != NULL)
png_ptr->user_chunk_cache_max = user_chunk_cache_max;
}
@@ -1796,6 +1804,8 @@ void PNGAPI
png_set_chunk_malloc_max(png_structrp png_ptr,
png_alloc_size_t user_chunk_malloc_max)
{
+ png_debug(1, "in png_set_chunk_malloc_max");
+
if (png_ptr != NULL)
png_ptr->user_chunk_malloc_max = user_chunk_malloc_max;
}
diff --git a/contrib/libs/libpng/pngtrans.c b/contrib/libs/libpng/pngtrans.c
index 1100f46ebe..62cb21edf1 100644
--- a/contrib/libs/libpng/pngtrans.c
+++ b/contrib/libs/libpng/pngtrans.c
@@ -1,7 +1,7 @@
/* pngtrans.c - transforms the data in a row (used by both readers and writers)
*
- * Copyright (c) 2018 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
@@ -103,10 +103,10 @@ png_set_interlace_handling(png_structrp png_ptr)
if (png_ptr != 0 && png_ptr->interlaced != 0)
{
png_ptr->transformations |= PNG_INTERLACE;
- return (7);
+ return 7;
}
- return (1);
+ return 1;
}
#endif
@@ -498,6 +498,8 @@ png_do_strip_channel(png_row_infop row_info, png_bytep row, int at_start)
png_bytep dp = row; /* destination pointer */
png_bytep ep = row + row_info->rowbytes; /* One beyond end of row */
+ png_debug(1, "in png_do_strip_channel");
+
/* At the start sp will point to the first byte to copy and dp to where
* it is copied to. ep always points just beyond the end of the row, so
* the loop simply copies (channels-1) channels until sp reaches ep.
@@ -698,6 +700,8 @@ png_do_bgr(png_row_infop row_info, png_bytep row)
void /* PRIVATE */
png_do_check_palette_indexes(png_structrp png_ptr, png_row_infop row_info)
{
+ png_debug(1, "in png_do_check_palette_indexes");
+
if (png_ptr->num_palette < (1 << row_info->bit_depth) &&
png_ptr->num_palette > 0) /* num_palette can be 0 in MNG files */
{
@@ -708,7 +712,7 @@ png_do_check_palette_indexes(png_structrp png_ptr, png_row_infop row_info)
* forms produced on either GCC or MSVC.
*/
int padding = PNG_PADBITS(row_info->pixel_depth, row_info->width);
- png_bytep rp = png_ptr->row_buf + row_info->rowbytes - 1;
+ png_bytep rp = png_ptr->row_buf + row_info->rowbytes;
switch (row_info->bit_depth)
{
@@ -833,7 +837,7 @@ png_voidp PNGAPI
png_get_user_transform_ptr(png_const_structrp png_ptr)
{
if (png_ptr == NULL)
- return (NULL);
+ return NULL;
return png_ptr->user_transform_ptr;
}
diff --git a/contrib/libs/libpng/pngwrite.c b/contrib/libs/libpng/pngwrite.c
index 8c6316e809..9f3743bf58 100644
--- a/contrib/libs/libpng/pngwrite.c
+++ b/contrib/libs/libpng/pngwrite.c
@@ -1,7 +1,7 @@
/* pngwrite.c - general routines to write a PNG file
*
- * Copyright (c) 2018-2023 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
@@ -378,7 +378,8 @@ png_write_end(png_structrp png_ptr, png_inforp info_ptr)
#endif
#ifdef PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED
- if (png_ptr->num_palette_max > png_ptr->num_palette)
+ if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE &&
+ png_ptr->num_palette_max >= png_ptr->num_palette)
png_benign_error(png_ptr, "Wrote palette index exceeding num_palette");
#endif
@@ -723,12 +724,12 @@ png_write_row(png_structrp png_ptr, png_const_bytep row)
/* 1.5.6: moved from png_struct to be a local structure: */
png_row_info row_info;
- if (png_ptr == NULL)
- return;
-
png_debug2(1, "in png_write_row (row %u, pass %d)",
png_ptr->row_number, png_ptr->pass);
+ if (png_ptr == NULL)
+ return;
+
/* Initialize transformations and other stuff if first time */
if (png_ptr->row_number == 0 && png_ptr->pass == 0)
{
@@ -1219,6 +1220,8 @@ png_set_compression_strategy(png_structrp png_ptr, int strategy)
void PNGAPI
png_set_compression_window_bits(png_structrp png_ptr, int window_bits)
{
+ png_debug(1, "in png_set_compression_window_bits");
+
if (png_ptr == NULL)
return;
@@ -1302,6 +1305,8 @@ png_set_text_compression_strategy(png_structrp png_ptr, int strategy)
void PNGAPI
png_set_text_compression_window_bits(png_structrp png_ptr, int window_bits)
{
+ png_debug(1, "in png_set_text_compression_window_bits");
+
if (png_ptr == NULL)
return;
@@ -1339,6 +1344,8 @@ png_set_text_compression_method(png_structrp png_ptr, int method)
void PNGAPI
png_set_write_status_fn(png_structrp png_ptr, png_write_status_ptr write_row_fn)
{
+ png_debug(1, "in png_set_write_status_fn");
+
if (png_ptr == NULL)
return;
@@ -1366,6 +1373,8 @@ void PNGAPI
png_write_png(png_structrp png_ptr, png_inforp info_ptr,
int transforms, voidp params)
{
+ png_debug(1, "in png_write_png");
+
if (png_ptr == NULL || info_ptr == NULL)
return;
diff --git a/contrib/libs/libpng/pngwutil.c b/contrib/libs/libpng/pngwutil.c
index 28d1f7bba1..bb731bc18b 100644
--- a/contrib/libs/libpng/pngwutil.c
+++ b/contrib/libs/libpng/pngwutil.c
@@ -1,7 +1,7 @@
/* pngwutil.c - utilities to write a PNG file
*
- * Copyright (c) 2018-2022 Cosmin Truta
+ * Copyright (c) 2018-2024 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.
@@ -2412,7 +2412,7 @@ png_setup_sub_row(png_structrp png_ptr, png_uint_32 bpp,
break;
}
- return (sum);
+ return sum;
}
static void /* PRIVATE */
@@ -2462,7 +2462,7 @@ png_setup_up_row(png_structrp png_ptr, size_t row_bytes, size_t lmins)
break;
}
- return (sum);
+ return sum;
}
static void /* PRIVATE */
png_setup_up_row_only(png_structrp png_ptr, size_t row_bytes)
@@ -2518,7 +2518,7 @@ png_setup_avg_row(png_structrp png_ptr, png_uint_32 bpp,
break;
}
- return (sum);
+ return sum;
}
static void /* PRIVATE */
png_setup_avg_row_only(png_structrp png_ptr, png_uint_32 bpp,
@@ -2601,7 +2601,7 @@ png_setup_paeth_row(png_structrp png_ptr, png_uint_32 bpp,
break;
}
- return (sum);
+ return sum;
}
static void /* PRIVATE */
png_setup_paeth_row_only(png_structrp png_ptr, png_uint_32 bpp,
diff --git a/contrib/libs/libpng/ya.make b/contrib/libs/libpng/ya.make
index 3533cb1e4b..586bbe1c9e 100644
--- a/contrib/libs/libpng/ya.make
+++ b/contrib/libs/libpng/ya.make
@@ -4,14 +4,15 @@ LIBRARY()
LICENSE(
Libpng AND
+ MIT AND
libpng-2.0
)
LICENSE_TEXTS(.yandex_meta/licenses.list.txt)
-VERSION(1.6.40)
+VERSION(1.6.44)
-ORIGINAL_SOURCE(https://github.com/pnggroup/libpng/archive/v1.6.40.tar.gz)
+ORIGINAL_SOURCE(https://github.com/pnggroup/libpng/archive/v1.6.44.tar.gz)
PEERDIR(
contrib/libs/zlib
@@ -28,6 +29,7 @@ NO_RUNTIME()
SRCS(
intel/filter_sse2_intrinsics.c
intel/intel_init.c
+ mips/filter_mmi_inline_assembly.c
mips/filter_msa_intrinsics.c
mips/mips_init.c
png.c