diff options
author | robot-piglet <robot-piglet@yandex-team.com> | 2025-01-22 15:08:02 +0300 |
---|---|---|
committer | robot-piglet <robot-piglet@yandex-team.com> | 2025-01-22 15:45:44 +0300 |
commit | 6ee15a2e28391bc6c3db3750ea13f2739c952530 (patch) | |
tree | 3bdad27d6557510e1253ea31fbc07d2224b0fbd3 /contrib | |
parent | 50b5088b27697d2ff6c22c8083ac5ed9343f9e82 (diff) | |
download | ydb-6ee15a2e28391bc6c3db3750ea13f2739c952530.tar.gz |
Intermediate changes
commit_hash:be3c9e45dca1966481082be8c2e45057e00eb428
Diffstat (limited to 'contrib')
44 files changed, 837 insertions, 615 deletions
diff --git a/contrib/libs/libpng/.yandex_meta/devtools.copyrights.report b/contrib/libs/libpng/.yandex_meta/devtools.copyrights.report index 9c2b4afd51..5c31247129 100644 --- a/contrib/libs/libpng/.yandex_meta/devtools.copyrights.report +++ b/contrib/libs/libpng/.yandex_meta/devtools.copyrights.report @@ -37,7 +37,7 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - pngwio.c [4:7] + pngwio.c [3:6] KEEP COPYRIGHT_SERVICE_LABEL 04f8b1b4b2cbfeeb2e57bfc469890488 BELONGS ya.make @@ -47,9 +47,9 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - pngconf.h [6:9] - pngrio.c [4:7] - pngwtran.c [4:7] + pngconf.h [5:8] + pngrio.c [3:6] + pngwtran.c [3:6] KEEP COPYRIGHT_SERVICE_LABEL 1a83a20a442f29d288b04d4b75acecee BELONGS ya.make @@ -63,9 +63,9 @@ BELONGS ya.make Match type : COPYRIGHT Files with this license: powerpc/filter_vsx_intrinsics.c [3:5] - powerpc/powerpc_init.c [4:6] + powerpc/powerpc_init.c [3:5] -KEEP COPYRIGHT_SERVICE_LABEL 2210a81b65840c39738f253134eca011 +KEEP COPYRIGHT_SERVICE_LABEL 222e0a740b7c184c1ce8edc0294b9350 BELONGS ya.make Note: matched license text is too long. Read it in the source files. Scancode info: @@ -74,7 +74,15 @@ BELONGS ya.make Match type : COPYRIGHT Files with this license: LICENSE [13:17] - png.h [36:40] + png.c [3:6] + png.c [797:803] + png.h [5:8] + png.h [35:39] + pngconf.h [5:8] + pnglibconf.h [5:6] + pngread.c [3:6] + pngset.c [3:6] + pngwrite.c [3:6] KEEP COPYRIGHT_SERVICE_LABEL 29987a3e22887759d4116a65229bc445 BELONGS ya.make @@ -84,7 +92,7 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - pnginfo.h [4:7] + pnginfo.h [3:6] KEEP COPYRIGHT_SERVICE_LABEL 3ac342a1877c8d682e0323f5fc8d82cd BELONGS ya.make @@ -95,7 +103,7 @@ BELONGS ya.make Match type : COPYRIGHT Files with this license: LICENSE [77:81] - png.h [100:104] + png.h [99:103] KEEP COPYRIGHT_SERVICE_LABEL 3e85c5cdcf5b38e730d8ce8321bc4e79 BELONGS ya.make @@ -108,8 +116,8 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - arm/arm_init.c [4:6] - arm/filter_neon_intrinsics.c [4:7] + arm/arm_init.c [3:5] + arm/filter_neon_intrinsics.c [3:6] KEEP COPYRIGHT_SERVICE_LABEL 408ae0448441d3cd270208218c23a2d3 BELONGS ya.make @@ -123,7 +131,7 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - INSTALL [460:463] + INSTALL [459:462] KEEP COPYRIGHT_SERVICE_LABEL 4223c36ebcb4c20e63cea90ec6c1c336 BELONGS ya.make @@ -133,17 +141,17 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - arm/filter_neon_intrinsics.c [4:7] - intel/filter_sse2_intrinsics.c [4:7] - intel/intel_init.c [4:7] - pngdebug.h [4:7] - pnginfo.h [4:7] - pngmem.c [4:7] - pngrio.c [4:7] - pngwio.c [4:7] - pngwtran.c [4:7] + arm/filter_neon_intrinsics.c [3:6] + intel/filter_sse2_intrinsics.c [3:6] + intel/intel_init.c [3:6] + pngdebug.h [3:6] + pnginfo.h [3:6] + pngmem.c [3:6] + pngrio.c [3:6] + pngwio.c [3:6] + pngwtran.c [3:6] powerpc/filter_vsx_intrinsics.c [3:5] - powerpc/powerpc_init.c [4:6] + powerpc/powerpc_init.c [3:5] KEEP COPYRIGHT_SERVICE_LABEL 4ab05cc7c9d27c8a3fbcc6350cf56230 BELONGS ya.make @@ -155,7 +163,7 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - arm/palette_neon_intrinsics.c [4:5] + arm/palette_neon_intrinsics.c [3:4] KEEP COPYRIGHT_SERVICE_LABEL 4d546ee23b58fd971b989e767c9f5a33 BELONGS ya.make @@ -169,8 +177,8 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - intel/filter_sse2_intrinsics.c [4:7] - intel/intel_init.c [4:7] + intel/filter_sse2_intrinsics.c [3:6] + intel/intel_init.c [3:6] KEEP COPYRIGHT_SERVICE_LABEL 51b32ca44bdc2a734f625cee7a36472b BELONGS ya.make @@ -180,13 +188,13 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - arm/arm_init.c [4:6] - pngstruct.h [4:7] + arm/arm_init.c [3:5] + pngstruct.h [3:6] KEEP COPYRIGHT_SERVICE_LABEL 5fc45730df09b1e4ad9f9d6a2d097232 BELONGS ya.make License text: - Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2024 Max Stepin, + Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2025 Max Stepin, and are delimited by "#ifdef PNG_APNG_SUPPORTED / #endif" directives surrounding them in the modified libpng source files. Scancode info: @@ -195,7 +203,7 @@ BELONGS ya.make Match type : COPYRIGHT Files with this license: LICENSE [6:8] - png.h [29:31] + png.h [28:30] KEEP COPYRIGHT_SERVICE_LABEL 62c7eae75018b876086b46cbfa6ba011 BELONGS ya.make @@ -207,30 +215,30 @@ BELONGS ya.make Files with this license: LICENSE [13:17] LICENSE [87:91] - png.c [4:7] - png.c [798:804] - png.h [6:9] - png.h [36:40] - png.h [110:114] - pngconf.h [6:9] - pngdebug.h [4:7] - pngerror.c [4:7] - pngget.c [4:7] - pnginfo.h [4:7] - pngmem.c [4:7] - pngpread.c [4:7] - pngpriv.h [4:7] - pngread.c [4:7] - pngrio.c [4:7] - pngrtran.c [4:7] - pngrutil.c [4:7] - pngset.c [4:7] - pngstruct.h [4:7] - pngtrans.c [4:7] - pngwio.c [4:7] - pngwrite.c [4:7] - pngwtran.c [4:7] - pngwutil.c [4:7] + png.c [3:6] + png.c [797:803] + png.h [5:8] + png.h [35:39] + png.h [109:113] + pngconf.h [5:8] + pngdebug.h [3:6] + pngerror.c [3:6] + pngget.c [3:6] + pnginfo.h [3:6] + pngmem.c [3:6] + pngpread.c [3:6] + pngpriv.h [3:6] + pngread.c [3:6] + pngrio.c [3:6] + pngrtran.c [3:6] + pngrutil.c [3:6] + pngset.c [3:6] + pngstruct.h [3:6] + pngtrans.c [3:6] + pngwio.c [3:6] + pngwrite.c [3:6] + pngwtran.c [3:6] + pngwutil.c [3:6] KEEP COPYRIGHT_SERVICE_LABEL 7e44d6c54a35ce9344b977e884ef180c BELONGS ya.make @@ -241,7 +249,7 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - arm/filter_neon.S [4:4] + arm/filter_neon.S [3:3] mips/filter_mmi_inline_assembly.c [3:4] KEEP COPYRIGHT_SERVICE_LABEL 9198506c7cb59dc577addf9c14d6ade1 @@ -252,34 +260,31 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - png.c [4:7] - png.c [798:804] - png.h [6:9] - pngget.c [4:7] + png.c [3:6] + png.c [797:803] + png.h [5:8] + pngget.c [3:6] pnglibconf.h [5:6] - pngpread.c [4:7] - pngpriv.h [4:7] - pngread.c [4:7] - pngrtran.c [4:7] - pngrutil.c [4:7] - pngstruct.h [4:7] - pngtrans.c [4:7] - pngwrite.c [4:7] - pngwutil.c [4:7] + pngpread.c [3:6] + pngpriv.h [3:6] + pngread.c [3:6] + pngrtran.c [3:6] + pngrutil.c [3:6] + pngstruct.h [3:6] + pngtrans.c [3:6] + pngwrite.c [3:6] + pngwutil.c [3:6] -KEEP COPYRIGHT_SERVICE_LABEL 9524c4c0aaaea5b1ba2ffbc048713d9e +KEEP COPYRIGHT_SERVICE_LABEL 94d354c99282b55820e97e6195cce85a BELONGS ya.make - License text: - 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. + 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 [6:8] - png.h [29:31] + LICENSE [13:17] + png.h [35:39] KEEP COPYRIGHT_SERVICE_LABEL a8a352211455dc7608a2fcc17b1d1029 BELONGS ya.make @@ -289,26 +294,16 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - 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] + mips/filter_msa_intrinsics.c [3:5] + mips/mips_init.c [3:6] + pngerror.c [3:6] + pngget.c [3:6] + pngpread.c [3:6] + pngpriv.h [3:6] + pngrtran.c [3:6] + pngrutil.c [3:6] + pngtrans.c [3:6] + pngwutil.c [3:6] KEEP COPYRIGHT_SERVICE_LABEL a9fe2e1b3b86d7489fcd47a2c9749dfe BELONGS ya.make @@ -320,30 +315,30 @@ BELONGS ya.make Files with this license: LICENSE [13:17] LICENSE [103:104] - png.c [4:7] - png.c [798:804] - png.h [6:9] - png.h [36:40] - png.h [126:127] - pngconf.h [6:9] - pngdebug.h [4:7] - pngerror.c [4:7] - pngget.c [4:7] - pnginfo.h [4:7] - pngmem.c [4:7] - pngpread.c [4:7] - pngpriv.h [4:7] - pngread.c [4:7] - pngrio.c [4:7] - pngrtran.c [4:7] - pngrutil.c [4:7] - pngset.c [4:7] - pngstruct.h [4:7] - pngtrans.c [4:7] - pngwio.c [4:7] - pngwrite.c [4:7] - pngwtran.c [4:7] - pngwutil.c [4:7] + png.c [3:6] + png.c [797:803] + png.h [5:8] + png.h [35:39] + png.h [125:126] + pngconf.h [5:8] + pngdebug.h [3:6] + pngerror.c [3:6] + pngget.c [3:6] + pnginfo.h [3:6] + pngmem.c [3:6] + pngpread.c [3:6] + pngpriv.h [3:6] + pngread.c [3:6] + pngrio.c [3:6] + pngrtran.c [3:6] + pngrutil.c [3:6] + pngset.c [3:6] + pngstruct.h [3:6] + pngtrans.c [3:6] + pngwio.c [3:6] + pngwrite.c [3:6] + pngwtran.c [3:6] + pngwutil.c [3:6] KEEP COPYRIGHT_SERVICE_LABEL b585c8f7e4acf8c0948a1fd9ab5daaaa BELONGS ya.make @@ -355,12 +350,12 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - arm/palette_neon_intrinsics.c [4:5] + arm/palette_neon_intrinsics.c [3:4] KEEP COPYRIGHT_SERVICE_LABEL b91f4788e32d0095f31d9f6910440991 BELONGS ya.make License text: - * Copyright (c) 2018-2024 Cosmin Truta + * Copyright (c) 2018-2025 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. @@ -369,7 +364,21 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - pngset.c [4:7] + pngset.c [3:6] + +KEEP COPYRIGHT_SERVICE_LABEL bf6d1f6f38395afb2d26a1bab41d837c +BELONGS ya.make + License text: + Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2025 Max Stepin, + and are delimited by "#ifdef PNG_APNG_SUPPORTED / #endif" directives + surrounding them in the modified libpng source files. + Scancode info: + Original SPDX id: COPYRIGHT_SERVICE_LABEL + Score : 100.00 + Match type : COPYRIGHT + Files with this license: + LICENSE [6:8] + png.h [28:30] KEEP COPYRIGHT_SERVICE_LABEL c486f222c872d0101647b08aaad5c74c BELONGS ya.make @@ -379,7 +388,7 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - pngerror.c [4:7] + pngerror.c [3:6] KEEP COPYRIGHT_SERVICE_LABEL ce9b1ec1cd75a32b887bd8ce4e049914 BELONGS ya.make @@ -391,8 +400,8 @@ BELONGS ya.make Files with this license: LICENSE [13:17] LICENSE [48:52] - png.h [36:40] - png.h [71:75] + png.h [35:39] + png.h [70:74] KEEP COPYRIGHT_SERVICE_LABEL cf0cd6fc41c47054b3d8821a52817bd0 BELONGS ya.make @@ -402,7 +411,7 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - pngmem.c [4:7] + pngmem.c [3:6] KEEP COPYRIGHT_SERVICE_LABEL d90f491706af2972a0d052bf061202af BELONGS ya.make @@ -412,7 +421,7 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - pngdebug.h [4:7] + pngdebug.h [3:6] KEEP COPYRIGHT_SERVICE_LABEL dd52acdc7afddfc8b562adacbabdfc2b BELONGS ya.make @@ -426,7 +435,7 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - INSTALL [460:463] + INSTALL [459:462] KEEP COPYRIGHT_SERVICE_LABEL e8596f616c40e549d2ea24adacc49cf7 BELONGS ya.make @@ -439,5 +448,5 @@ BELONGS ya.make Score : 100.00 Match type : COPYRIGHT Files with this license: - mips/filter_msa_intrinsics.c [4:6] - mips/mips_init.c [4:7] + mips/filter_msa_intrinsics.c [3:5] + mips/mips_init.c [3:6] diff --git a/contrib/libs/libpng/.yandex_meta/devtools.licenses.report b/contrib/libs/libpng/.yandex_meta/devtools.licenses.report index 52148e46d8..b1895bd381 100644 --- a/contrib/libs/libpng/.yandex_meta/devtools.licenses.report +++ b/contrib/libs/libpng/.yandex_meta/devtools.licenses.report @@ -54,7 +54,7 @@ BELONGS ya.make Match type : REFERENCE 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: - png.h [123:126] + png.h [122:125] KEEP Libpng 1d940ec90e4aa15211472accfdd6ed04 BELONGS ya.make @@ -79,7 +79,7 @@ BELONGS ya.make Match type : REFERENCE 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: - png.h [101:102] + png.h [100:101] KEEP Libpng 2258163fda85c81b35966fee33b40b5b BELONGS ya.make @@ -106,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 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 +FILE_IGNORE include/png.h found in files: arm/arm_init.c at line 9, arm/filter_neon.S at line 7, arm/filter_neon_intrinsics.c at line 10, arm/palette_neon_intrinsics.c at line 9, intel/filter_sse2_intrinsics.c at line 10, intel/intel_init.c at line 10, mips/filter_mmi_inline_assembly.c at line 8, mips/filter_msa_intrinsics.c at line 9, mips/mips_init.c at line 10, png.c at line 10, pngconf.h at line 12, pngdebug.h at line 10, pngerror.c at line 10, pngget.c at line 10, pnginfo.h at line 10, pngmem.c at line 10, pngpread.c at line 10, pngpriv.h at line 10, pngread.c at line 10, pngrio.c at line 10, pngrtran.c at line 10, pngrutil.c at line 10, pngset.c at line 10, pngstruct.h at line 10, pngtrans.c at line 10, pngwio.c at line 10, pngwrite.c at line 10, pngwtran.c at line 10, pngwutil.c at line 10, powerpc/filter_vsx_intrinsics.c at line 9, powerpc/powerpc_init.c at line 9 +FILE_IGNORE png.h found in files: arm/arm_init.c at line 9, arm/filter_neon.S at line 7, arm/filter_neon_intrinsics.c at line 10, arm/palette_neon_intrinsics.c at line 9, intel/filter_sse2_intrinsics.c at line 10, intel/intel_init.c at line 10, mips/filter_mmi_inline_assembly.c at line 8, mips/filter_msa_intrinsics.c at line 9, mips/mips_init.c at line 10, png.c at line 10, pngconf.h at line 12, pngdebug.h at line 10, pngerror.c at line 10, pngget.c at line 10, pnginfo.h at line 10, pngmem.c at line 10, pngpread.c at line 10, pngpriv.h at line 10, pngread.c at line 10, pngrio.c at line 10, pngrtran.c at line 10, pngrutil.c at line 10, pngset.c at line 10, pngstruct.h at line 10, pngtrans.c at line 10, pngwio.c at line 10, pngwrite.c at line 10, pngwtran.c at line 10, pngwutil.c at line 10, powerpc/filter_vsx_intrinsics.c at line 9, powerpc/powerpc_init.c at line 9 License text: * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -118,37 +118,37 @@ FILE_IGNORE png.h found in files: arm/arm_init.c at line 10, arm/filter_neon.S a 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: - arm/arm_init.c [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] + arm/arm_init.c [7:9] + arm/filter_neon.S [5:7] + arm/filter_neon_intrinsics.c [8:10] + arm/palette_neon_intrinsics.c [7:9] + intel/filter_sse2_intrinsics.c [8:10] + intel/intel_init.c [8:10] mips/filter_mmi_inline_assembly.c [6:8] - mips/filter_msa_intrinsics.c [8:10] - mips/mips_init.c [9:11] - png.c [9:11] - pngconf.h [11:13] - pngdebug.h [9:11] - pngerror.c [9:11] - pngget.c [9:11] - pnginfo.h [9:11] - pngmem.c [9:11] - pngpread.c [9:11] - pngpriv.h [9:11] - pngread.c [9:11] - pngrio.c [9:11] - pngrtran.c [9:11] - pngrutil.c [9:11] - pngset.c [9:11] - pngstruct.h [9:11] - pngtrans.c [9:11] - pngwio.c [9:11] - pngwrite.c [9:11] - pngwtran.c [9:11] - pngwutil.c [9:11] + mips/filter_msa_intrinsics.c [7:9] + mips/mips_init.c [8:10] + png.c [8:10] + pngconf.h [10:12] + pngdebug.h [8:10] + pngerror.c [8:10] + pngget.c [8:10] + pnginfo.h [8:10] + pngmem.c [8:10] + pngpread.c [8:10] + pngpriv.h [8:10] + pngread.c [8:10] + pngrio.c [8:10] + pngrtran.c [8:10] + pngrutil.c [8:10] + pngset.c [8:10] + pngstruct.h [8:10] + pngtrans.c [8:10] + pngwio.c [8:10] + pngwrite.c [8:10] + pngwtran.c [8:10] + pngwutil.c [8:10] powerpc/filter_vsx_intrinsics.c [7:9] - powerpc/powerpc_init.c [8:10] + powerpc/powerpc_init.c [7:9] KEEP Libpng 419f10c6f64f7f94b607500def672b4c BELONGS ya.make @@ -162,6 +162,17 @@ BELONGS ya.make Files with this license: LICENSE [50:50] +KEEP libpng-2.0 4beda1c70e573a3713d776864e366f19 +BELONGS ya.make + Note: matched license text is too long. Read it in the source files. + Scancode info: + Original SPDX id: libpng-2.0 + Score : 93.22 + 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: + png.h [35:64] + KEEP Libpng 4bf58b7572cda8b7eb2355dfa5b6069b BELONGS ya.make FILE_IGNORE include/png.h found in files: pnglibconf.h at line 10 @@ -178,6 +189,18 @@ FILE_IGNORE png.h found in files: pnglibconf.h at line 10 Files with this license: pnglibconf.h [8:10] +KEEP libpng-2.0 5208e45400f1dd9d333b740e7fdfe0aa +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] + SKIP LicenseRef-scancode-unknown-license-reference 57999f604e5825fbd6cf183bd21ff5a7 BELONGS ya.make FILE_IGNORE include/png.h found in files: CHANGES at line 527 @@ -221,8 +244,8 @@ BELONGS ya.make KEEP Libpng 7600efc02108131a57254bd359eb81ec BELONGS ya.make -FILE_IGNORE include/png.h found in files: INSTALL at line 464 -FILE_IGNORE png.h found in files: INSTALL at line 464 +FILE_IGNORE include/png.h found in files: INSTALL at line 463 +FILE_IGNORE png.h found in files: INSTALL at line 463 License text: This document is released under the libpng license. For conditions of distribution and use, see the disclaimer @@ -233,18 +256,7 @@ FILE_IGNORE png.h found in files: INSTALL at line 464 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: - INSTALL [462:464] - -KEEP libpng-2.0 7799c593fa0c34cd88d48e7a212af031 -BELONGS ya.make - Note: matched license text is too long. Read it in the source files. - Scancode info: - Original SPDX id: libpng-2.0 - Score : 93.22 - 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: - png.h [36:65] + INSTALL [461:463] KEEP Libpng 7efd0a90adbbc5ab678061147a6c1b22 BELONGS ya.make @@ -262,7 +274,7 @@ BELONGS ya.make KEEP Libpng 8052e10193c850afb17b137c4fefb079 BELONGS ya.make -FILE_INCLUDE LICENSE found in files: png.h at line 11 +FILE_INCLUDE LICENSE found in files: png.h at line 10 License text: * This code is released under the libpng license. (See LICENSE, below.) Scancode info: @@ -271,7 +283,7 @@ FILE_INCLUDE LICENSE found in files: png.h at line 11 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: - png.h [11:11] + png.h [10:10] KEEP Libpng 89f1af56c09553ceb984867cb39121fd BELONGS ya.make @@ -298,7 +310,7 @@ BELONGS ya.make 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] + AUTHORS [60:62] KEEP Libpng a1fa29c834710a6f595de023fcd8738f BELONGS ya.make @@ -310,7 +322,7 @@ BELONGS ya.make Match type : REFERENCE 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: - png.h [111:111] + png.h [110:110] KEEP Libpng a4cede44049edd3aa6708c55870aa4e2 BELONGS ya.make @@ -321,7 +333,7 @@ BELONGS ya.make Match type : TEXT 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: - png.h [102:163] + png.h [101:162] KEEP Libpng b3dffe414d279acaf02a20ca7ddac567 BELONGS ya.make @@ -333,7 +345,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: - png.h [28:28] + png.h [27:27] KEEP Libpng b962c792285cc610bb3aed619261d8a9 BELONGS ya.make @@ -372,7 +384,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 [56:56] + AUTHORS [57:57] SKIP LicenseRef-scancode-free-unknown d21cb537845df6d3bd33063822351d5a BELONGS ya.make @@ -386,7 +398,7 @@ BELONGS ya.make Match type : NOTICE Links : https://github.com/nexB/scancode-toolkit/tree/develop/src/licensedcode/data/licenses/free-unknown.LICENSE Files with this license: - png.h [97:98] + png.h [96:97] KEEP Libpng d25adc0a2183d65a4e22d7e88851e2ff BELONGS ya.make @@ -422,7 +434,7 @@ BELONGS ya.make Match type : TEXT 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: - png.h [73:94] + png.h [72:93] KEEP Libpng e9bb4f8fbab91484ba62ccb1611b70bb BELONGS ya.make @@ -434,7 +446,7 @@ BELONGS ya.make Match type : REFERENCE 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: - png.h [73:73] + png.h [72:72] KEEP Libpng e9ec5df2670a4a277520cf3f626cccae BELONGS ya.make @@ -472,18 +484,6 @@ 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 1e6d12772b..7586de61ed 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-2024 The PNG Reference Library Authors. - * Copyright (c) 2018-2024 Cosmin Truta. + * Copyright (c) 1995-2025 The PNG Reference Library Authors. + * Copyright (c) 2018-2025 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. @@ -67,44 +67,44 @@ ====================COPYRIGHT==================== * Copyright (c) 2018-2024 Cosmin Truta - * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson + * 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-2024 Cosmin Truta - * Copyright (c) 1998-2002,2004,2006-2017 Glenn Randers-Pehrson + * Copyright (c) 2016 Glenn Randers-Pehrson + * Written by Mandar Sahastrabuddhe, August 2016 + + +====================COPYRIGHT==================== + * Copyright (c) 2018-2025 Cosmin Truta + * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson * Copyright (c) 1996-1997 Andreas Dilger * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. ====================COPYRIGHT==================== - * Copyright (c) 2018-2024 Cosmin Truta + * Copyright (c) 2018-2025 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson * Copyright (c) 1996-1997 Andreas Dilger * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. ====================COPYRIGHT==================== - * Copyright (c) 2018-2024 Cosmin Truta + * Copyright (c) 2018-2025 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, +Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2025 Max Stepin, and are delimited by "#ifdef PNG_APNG_SUPPORTED / #endif" directives surrounding them in the modified libpng source files. @@ -125,7 +125,6 @@ list of Contributing Authors: ====================File: INSTALL==================== - Installing libpng Contents @@ -597,15 +596,15 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE This modified version of libpng code adds animated PNG support and is released under the libpng license described below. The modifications are -Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2024 Max Stepin, +Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2025 Max Stepin, and are delimited by "#ifdef PNG_APNG_SUPPORTED / #endif" directives surrounding them in the modified libpng source files. PNG Reference Library License version 2 --------------------------------------- - * Copyright (c) 1995-2024 The PNG Reference Library Authors. - * Copyright (c) 2018-2024 Cosmin Truta. + * Copyright (c) 1995-2025 The PNG Reference Library Authors. + * Copyright (c) 2018-2025 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. @@ -1017,8 +1016,8 @@ released under the libpng license described below. The modifications are ====================libpng-2.0==================== - * * Copyright (c) 1995-2024 The PNG Reference Library Authors. - * * Copyright (c) 2018-2024 Cosmin Truta. + * * Copyright (c) 1995-2025 The PNG Reference Library Authors. + * * Copyright (c) 2018-2025 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. @@ -1055,15 +1054,15 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE This modified version of libpng code adds animated PNG support and is released under the libpng license described below. The modifications are -Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2024 Max Stepin, +Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2025 Max Stepin, and are delimited by "#ifdef PNG_APNG_SUPPORTED / #endif" directives surrounding them in the modified libpng source files. PNG Reference Library License version 2 --------------------------------------- - * Copyright (c) 1995-2024 The PNG Reference Library Authors. - * Copyright (c) 2018-2024 Cosmin Truta. + * Copyright (c) 1995-2025 The PNG Reference Library Authors. + * Copyright (c) 2018-2025 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 c3ac881494..cc7d52c21c 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.44"; + version = "1.6.45"; src = fetchFromGitHub { owner = "pnggroup"; repo = "libpng"; rev = "v${version}"; - hash = "sha256-gBfHgGaqVYdmhWXoNKZzPyGzyw2rr3zp+DjWmfC41jk="; + hash = "sha256-kO0f65oHhnwrdhCIe2XbyihODxKKKWsJsh+QJS2uBtc="; }; # 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 a2a7ac363a..719b23abc4 100644 --- a/contrib/libs/libpng/ANNOUNCE +++ b/contrib/libs/libpng/ANNOUNCE @@ -1,5 +1,5 @@ -libpng 1.6.44 - September 12, 2024 -================================== +libpng 1.6.45 - January 7, 2025 +=============================== This is a public release of libpng, intended for use in production code. @@ -9,13 +9,13 @@ Files available for download Source files with LF line endings (for Unix/Linux): - * libpng-1.6.44.tar.xz (LZMA-compressed, recommended) - * libpng-1.6.44.tar.gz (deflate-compressed) + * libpng-1.6.45.tar.xz (LZMA-compressed, recommended) + * libpng-1.6.45.tar.gz (deflate-compressed) Source files with CRLF line endings (for Windows): - * lpng1644.7z (LZMA-compressed, recommended) - * lpng1644.zip (deflate-compressed) + * lpng1645.7z (LZMA-compressed, recommended) + * lpng1645.zip (deflate-compressed) Other information: @@ -25,29 +25,18 @@ Other information: * TRADEMARK.md -Changes from version 1.6.43 to version 1.6.44 +Changes from version 1.6.44 to version 1.6.45 --------------------------------------------- - * 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. + * Added support for the cICP chunk. + (Contributed by Lucas Chollet and John Bowler) + * Adjusted and improved various checks in colorspace calculations. (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. + * Rearranged the write order of colorspace chunks for better conformance + with the PNG v3 draft specification. + (Contributed by John Bowler) + * Raised the minimum required CMake version from 3.6 to 3.14. + * Forked off a development branch for libpng version 1.8. 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 544341694a..f30a4ee192 100644 --- a/contrib/libs/libpng/AUTHORS +++ b/contrib/libs/libpng/AUTHORS @@ -17,6 +17,7 @@ Authors, for copyright and licensing purposes. * James Yu * John Bowler * Kevin Bracey + * Lucas Chollet * Magnus Holmgren * Mandar Sahastrabuddhe * Mans Rullgard diff --git a/contrib/libs/libpng/CHANGES b/contrib/libs/libpng/CHANGES index 724ccca2d6..3f37f3f393 100644 --- a/contrib/libs/libpng/CHANGES +++ b/contrib/libs/libpng/CHANGES @@ -6218,6 +6218,17 @@ Version 1.6.44 [September 12, 2024] (Contributed by Ben Wagner) Fixed and improved the config files for AppVeyor CI and Travis CI. +Version 1.6.45 [January 7, 2025] + Added support for the cICP chunk. + (Contributed by Lucas Chollet and John Bowler) + Adjusted and improved various checks in colorspace calculations. + (Contributed by John Bowler) + Rearranged the write order of colorspace chunks for better conformance + with the PNG v3 draft specification. + (Contributed by John Bowler) + Raised the minimum required CMake version from 3.6 to 3.14. + Forked off a development branch for libpng version 1.8. + 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/INSTALL b/contrib/libs/libpng/INSTALL index 042d729291..df1a494468 100644 --- a/contrib/libs/libpng/INSTALL +++ b/contrib/libs/libpng/INSTALL @@ -1,4 +1,3 @@ - Installing libpng Contents diff --git a/contrib/libs/libpng/LICENSE b/contrib/libs/libpng/LICENSE index 1ea1f8b85f..7e6e5b25b0 100644 --- a/contrib/libs/libpng/LICENSE +++ b/contrib/libs/libpng/LICENSE @@ -3,15 +3,15 @@ COPYRIGHT NOTICE, DISCLAIMER, and LICENSE This modified version of libpng code adds animated PNG support and is released under the libpng license described below. The modifications are -Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2024 Max Stepin, +Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2025 Max Stepin, and are delimited by "#ifdef PNG_APNG_SUPPORTED / #endif" directives surrounding them in the modified libpng source files. PNG Reference Library License version 2 --------------------------------------- - * Copyright (c) 1995-2024 The PNG Reference Library Authors. - * Copyright (c) 2018-2024 Cosmin Truta. + * Copyright (c) 1995-2025 The PNG Reference Library Authors. + * Copyright (c) 2018-2025 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 3af606889b..1f73eb58cf 100644 --- a/contrib/libs/libpng/README +++ b/contrib/libs/libpng/README @@ -1,4 +1,4 @@ -README for libpng version 1.6.44 +README for libpng version 1.6.45 ================================ See the note about version numbers near the top of `png.h`. @@ -157,8 +157,6 @@ Files included in this distribution "PNG: The Definitive Guide" by Greg Roelofs, O'Reilly, 1999 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 diff --git a/contrib/libs/libpng/TODO b/contrib/libs/libpng/TODO index 562dab0696..8ddb7d123c 100644 --- a/contrib/libs/libpng/TODO +++ b/contrib/libs/libpng/TODO @@ -1,23 +1,22 @@ -TODO - list of things to do for libpng: +TODO list for libpng +-------------------- -* Fix all defects (duh!) -* Better C++ wrapper / full C++ implementation (?) -* Fix the problems with C++ and 'extern "C"'. -* cHRM transformation. -* Palette creation. -* "grayscale->palette" transformation and "palette->grayscale" detection. -* Improved dithering. -* Multi-lingual error and warning message support. -* Complete sRGB transformation. (Currently it simply uses gamma=0.45455.) -* Man pages for function calls. -* Better documentation. -* Better filter selection - (e.g., counting huffman bits/precompression; filter inertia; filter costs). -* Histogram creation. -* Text conversion between different code pages (e.g., Latin-1 -> Mac). -* Avoid building gamma tables whenever possible. -* Greater precision in changing to linear gamma for compositing against - background, and in doing rgb-to-gray transformations. -* Investigate pre-incremented loop counters and other loop constructions. -* Interpolated method of handling interlacing. -* More validations for libpng transformations. + * Fix all defects (duh!) + * cHRM transformation. + * Palette creation. + * "grayscale->palette" transformation and "palette->grayscale" detection. + * Improved dithering. + * Multi-lingual error and warning message support. + * Complete sRGB transformation. (Currently it simply uses gamma=0.45455.) + * Man pages for function calls. + * Better documentation. + * Better filter selection + (e.g., counting huffman bits/precompression; filter inertia; filter costs). + * Histogram creation. + * Text conversion between different code pages (e.g., Latin-1 to Mac). + * Avoid building gamma tables whenever possible. + * Greater precision in changing to linear gamma for compositing against + background, and in doing rgb-to-gray transformations. + * Investigate pre-incremented loop counters and other loop constructions. + * Interpolated method of handling interlacing. + * More validations for libpng transformations. diff --git a/contrib/libs/libpng/arm/arm_init.c b/contrib/libs/libpng/arm/arm_init.c index 1fcda2eba4..d7f137b3cb 100644 --- a/contrib/libs/libpng/arm/arm_init.c +++ b/contrib/libs/libpng/arm/arm_init.c @@ -1,4 +1,3 @@ - /* arm_init.c - NEON optimised filter functions * * Copyright (c) 2018-2022 Cosmin Truta diff --git a/contrib/libs/libpng/arm/filter_neon.S b/contrib/libs/libpng/arm/filter_neon.S index fc3c7a2964..0cbd372cb1 100644 --- a/contrib/libs/libpng/arm/filter_neon.S +++ b/contrib/libs/libpng/arm/filter_neon.S @@ -1,4 +1,3 @@ - /* filter_neon.S - placeholder file * * Copyright (c) 2024 Cosmin Truta diff --git a/contrib/libs/libpng/arm/filter_neon_intrinsics.c b/contrib/libs/libpng/arm/filter_neon_intrinsics.c index 4466d48b20..7c3e0da4d8 100644 --- a/contrib/libs/libpng/arm/filter_neon_intrinsics.c +++ b/contrib/libs/libpng/arm/filter_neon_intrinsics.c @@ -1,4 +1,3 @@ - /* filter_neon_intrinsics.c - NEON optimised filter functions * * Copyright (c) 2018 Cosmin Truta diff --git a/contrib/libs/libpng/arm/palette_neon_intrinsics.c b/contrib/libs/libpng/arm/palette_neon_intrinsics.c index 92c7d6f9f6..3068e9b6e6 100644 --- a/contrib/libs/libpng/arm/palette_neon_intrinsics.c +++ b/contrib/libs/libpng/arm/palette_neon_intrinsics.c @@ -1,4 +1,3 @@ - /* palette_neon_intrinsics.c - NEON optimised palette expansion functions * * Copyright (c) 2018-2019 Cosmin Truta @@ -64,7 +63,7 @@ png_do_expand_palette_rgba8_neon(png_structrp png_ptr, png_row_infop row_info, { png_uint_32 row_width = row_info->width; const png_uint_32 *riffled_palette = - (const png_uint_32 *)png_ptr->riffled_palette; + png_aligncastconst(png_const_uint_32p, png_ptr->riffled_palette); const png_uint_32 pixels_per_chunk = 4; png_uint_32 i; diff --git a/contrib/libs/libpng/intel/filter_sse2_intrinsics.c b/contrib/libs/libpng/intel/filter_sse2_intrinsics.c index d3c0fe9e2d..2993f650b7 100644 --- a/contrib/libs/libpng/intel/filter_sse2_intrinsics.c +++ b/contrib/libs/libpng/intel/filter_sse2_intrinsics.c @@ -1,4 +1,3 @@ - /* filter_sse2_intrinsics.c - SSE2 optimized filter functions * * Copyright (c) 2018 Cosmin Truta diff --git a/contrib/libs/libpng/intel/intel_init.c b/contrib/libs/libpng/intel/intel_init.c index 2f8168b7c4..9e4610d25b 100644 --- a/contrib/libs/libpng/intel/intel_init.c +++ b/contrib/libs/libpng/intel/intel_init.c @@ -1,4 +1,3 @@ - /* intel_init.c - SSE2 optimized filter functions * * Copyright (c) 2018 Cosmin Truta diff --git a/contrib/libs/libpng/mips/filter_msa_intrinsics.c b/contrib/libs/libpng/mips/filter_msa_intrinsics.c index 1b734f4d9a..a294f55130 100644 --- a/contrib/libs/libpng/mips/filter_msa_intrinsics.c +++ b/contrib/libs/libpng/mips/filter_msa_intrinsics.c @@ -1,4 +1,3 @@ - /* filter_msa_intrinsics.c - MSA optimised filter functions * * Copyright (c) 2018-2024 Cosmin Truta @@ -47,7 +46,7 @@ uint8_t *psrc_lw_m = (uint8_t *) (psrc); \ uint32_t val_m; \ \ - asm volatile ( \ + __asm__ volatile ( \ "lw %[val_m], %[psrc_lw_m] \n\t" \ \ : [val_m] "=r" (val_m) \ @@ -62,7 +61,7 @@ uint8_t *pdst_sh_m = (uint8_t *) (pdst); \ uint16_t val_m = (val); \ \ - asm volatile ( \ + __asm__ volatile ( \ "sh %[val_m], %[pdst_sh_m] \n\t" \ \ : [pdst_sh_m] "=m" (*pdst_sh_m) \ @@ -75,7 +74,7 @@ uint8_t *pdst_sw_m = (uint8_t *) (pdst); \ uint32_t val_m = (val); \ \ - asm volatile ( \ + __asm__ volatile ( \ "sw %[val_m], %[pdst_sw_m] \n\t" \ \ : [pdst_sw_m] "=m" (*pdst_sw_m) \ @@ -83,20 +82,20 @@ ); \ } - #if (__mips == 64) + #if __mips == 64 #define SD(val, pdst) \ { \ uint8_t *pdst_sd_m = (uint8_t *) (pdst); \ uint64_t val_m = (val); \ \ - asm volatile ( \ + __asm__ volatile ( \ "sd %[val_m], %[pdst_sd_m] \n\t" \ \ : [pdst_sd_m] "=m" (*pdst_sd_m) \ : [val_m] "r" (val_m) \ ); \ } - #else + #else #define SD(val, pdst) \ { \ uint8_t *pdst_sd_m = (uint8_t *) (pdst); \ @@ -108,17 +107,17 @@ SW(val0_m, pdst_sd_m); \ SW(val1_m, pdst_sd_m + 4); \ } - #endif + #endif /* __mips == 64 */ #else #define MSA_SRLI_B(a, b) (a >> b) -#if (__mips_isa_rev >= 6) +#if __mips_isa_rev >= 6 #define LW(psrc) \ ( { \ uint8_t *psrc_lw_m = (uint8_t *) (psrc); \ uint32_t val_m; \ \ - asm volatile ( \ + __asm__ volatile ( \ "lw %[val_m], %[psrc_lw_m] \n\t" \ \ : [val_m] "=r" (val_m) \ @@ -133,7 +132,7 @@ uint8_t *pdst_sh_m = (uint8_t *) (pdst); \ uint16_t val_m = (val); \ \ - asm volatile ( \ + __asm__ volatile ( \ "sh %[val_m], %[pdst_sh_m] \n\t" \ \ : [pdst_sh_m] "=m" (*pdst_sh_m) \ @@ -146,7 +145,7 @@ uint8_t *pdst_sw_m = (uint8_t *) (pdst); \ uint32_t val_m = (val); \ \ - asm volatile ( \ + __asm__ volatile ( \ "sw %[val_m], %[pdst_sw_m] \n\t" \ \ : [pdst_sw_m] "=m" (*pdst_sw_m) \ @@ -154,20 +153,20 @@ ); \ } - #if (__mips == 64) + #if __mips == 64 #define SD(val, pdst) \ { \ uint8_t *pdst_sd_m = (uint8_t *) (pdst); \ uint64_t val_m = (val); \ \ - asm volatile ( \ + __asm__ volatile ( \ "sd %[val_m], %[pdst_sd_m] \n\t" \ \ : [pdst_sd_m] "=m" (*pdst_sd_m) \ : [val_m] "r" (val_m) \ ); \ } - #else + #else #define SD(val, pdst) \ { \ uint8_t *pdst_sd_m = (uint8_t *) (pdst); \ @@ -179,14 +178,14 @@ SW(val0_m, pdst_sd_m); \ SW(val1_m, pdst_sd_m + 4); \ } - #endif -#else // !(__mips_isa_rev >= 6) + #endif /* __mips == 64 */ +#else #define LW(psrc) \ ( { \ uint8_t *psrc_lw_m = (uint8_t *) (psrc); \ uint32_t val_m; \ \ - asm volatile ( \ + __asm__ volatile ( \ "ulw %[val_m], %[psrc_lw_m] \n\t" \ \ : [val_m] "=r" (val_m) \ @@ -201,7 +200,7 @@ uint8_t *pdst_sh_m = (uint8_t *) (pdst); \ uint16_t val_m = (val); \ \ - asm volatile ( \ + __asm__ volatile ( \ "ush %[val_m], %[pdst_sh_m] \n\t" \ \ : [pdst_sh_m] "=m" (*pdst_sh_m) \ @@ -214,7 +213,7 @@ uint8_t *pdst_sw_m = (uint8_t *) (pdst); \ uint32_t val_m = (val); \ \ - asm volatile ( \ + __asm__ volatile ( \ "usw %[val_m], %[pdst_sw_m] \n\t" \ \ : [pdst_sw_m] "=m" (*pdst_sw_m) \ @@ -222,7 +221,7 @@ ); \ } - #define SD(val, pdst) \ + #define SD(val, pdst) \ { \ uint8_t *pdst_sd_m = (uint8_t *) (pdst); \ uint32_t val0_m, val1_m; \ @@ -238,14 +237,14 @@ { \ uint8_t *pdst_m = (uint8_t *) (pdst); \ \ - asm volatile ( \ + __asm__ volatile ( \ "usw $0, %[pdst_m] \n\t" \ \ : [pdst_m] "=m" (*pdst_m) \ : \ ); \ } -#endif // (__mips_isa_rev >= 6) +#endif /* __mips_isa_rev >= 6 */ #endif #define LD_B(RTYPE, psrc) *((RTYPE *) (psrc)) diff --git a/contrib/libs/libpng/mips/mips_init.c b/contrib/libs/libpng/mips/mips_init.c index 28bd45c671..3531454c75 100644 --- a/contrib/libs/libpng/mips/mips_init.c +++ b/contrib/libs/libpng/mips/mips_init.c @@ -1,4 +1,3 @@ - /* mips_init.c - MSA optimised filter functions * * Copyright (c) 2018-2024 Cosmin Truta diff --git a/contrib/libs/libpng/patches/apng.patch b/contrib/libs/libpng/patches/apng.patch index fe13cc4e79..d84f400e8e 100644 --- a/contrib/libs/libpng/patches/apng.patch +++ b/contrib/libs/libpng/patches/apng.patch @@ -8,7 +8,7 @@ Index: LICENSE +This modified version of libpng code adds animated PNG support and is +released under the libpng license described below. The modifications are -+Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2024 Max Stepin, ++Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2025 Max Stepin, +and are delimited by "#ifdef PNG_APNG_SUPPORTED / #endif" directives +surrounding them in the modified libpng source files. + @@ -19,7 +19,7 @@ Index: pngread.c =================================================================== --- a/pngread.c +++ b/pngread.c -@@ -161,6 +161,9 @@ +@@ -160,6 +160,9 @@ else if (chunk_name == png_IDAT) { @@ -29,7 +29,7 @@ Index: pngread.c png_ptr->idat_size = length; break; } -@@ -255,6 +258,17 @@ +@@ -259,6 +262,17 @@ png_handle_iTXt(png_ptr, info_ptr, length); #endif @@ -47,7 +47,7 @@ Index: pngread.c else png_handle_unknown(png_ptr, info_ptr, length, PNG_HANDLE_CHUNK_AS_DEFAULT); -@@ -262,6 +276,72 @@ +@@ -266,6 +280,72 @@ } #endif /* SEQUENTIAL_READ */ @@ -124,7 +124,7 @@ Index: pngget.c =================================================================== --- a/pngget.c +++ b/pngget.c -@@ -1264,4 +1264,166 @@ +@@ -1288,4 +1288,166 @@ # endif #endif @@ -295,20 +295,20 @@ Index: png.h =================================================================== --- a/png.h +++ b/png.h -@@ -24,6 +24,12 @@ +@@ -23,6 +23,12 @@ * COPYRIGHT NOTICE, DISCLAIMER, and LICENSE * ========================================= * + * This modified version of libpng code adds animated PNG support and is + * released under the libpng license described below. The modifications are -+ * Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2024 Max Stepin, ++ * Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2025 Max Stepin, + * and are delimited by "#ifdef PNG_APNG_SUPPORTED / #endif" directives + * surrounding them in the modified libpng source files. + * * PNG Reference Library License version 2 * --------------------------------------- * -@@ -329,6 +336,10 @@ +@@ -328,6 +335,10 @@ # include "pnglibconf.h" #endif @@ -319,7 +319,7 @@ Index: png.h #ifndef PNG_VERSION_INFO_ONLY /* Machine specific configuration. */ # include "pngconf.h" -@@ -424,6 +435,17 @@ +@@ -423,6 +434,17 @@ * See pngconf.h for base types that vary by machine/system */ @@ -338,12 +338,12 @@ Index: png.h * do not agree upon the version number. */ @@ -745,6 +767,10 @@ - #define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */ #define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */ #define PNG_INFO_eXIf 0x10000U /* GR-P, 1.6.31 */ + #define PNG_INFO_cICP 0x20000U +#ifdef PNG_APNG_SUPPORTED -+#define PNG_INFO_acTL 0x20000U -+#define PNG_INFO_fcTL 0x40000U ++#define PNG_INFO_acTL 0x40000U ++#define PNG_INFO_fcTL 0x80000U +#endif /* This is used for the transformation routines, as some of them @@ -359,75 +359,75 @@ Index: png.h /* The following callback receives png_uint_32 row_number, int pass for the * png_bytep data of the row. When transforming an interlaced image the -@@ -3230,6 +3260,75 @@ +@@ -3241,6 +3271,75 @@ * END OF HARDWARE AND SOFTWARE OPTIONS ******************************************************************************/ +#ifdef PNG_APNG_SUPPORTED -+PNG_EXPORT(250, png_uint_32, png_get_acTL, (png_structp png_ptr, ++PNG_EXPORT(252, png_uint_32, png_get_acTL, (png_structp png_ptr, + png_infop info_ptr, png_uint_32 *num_frames, png_uint_32 *num_plays)); + -+PNG_EXPORT(251, png_uint_32, png_set_acTL, (png_structp png_ptr, ++PNG_EXPORT(253, png_uint_32, png_set_acTL, (png_structp png_ptr, + png_infop info_ptr, png_uint_32 num_frames, png_uint_32 num_plays)); + -+PNG_EXPORT(252, png_uint_32, png_get_num_frames, (png_structp png_ptr, ++PNG_EXPORT(254, png_uint_32, png_get_num_frames, (png_structp png_ptr, + png_infop info_ptr)); + -+PNG_EXPORT(253, png_uint_32, png_get_num_plays, (png_structp png_ptr, ++PNG_EXPORT(255, png_uint_32, png_get_num_plays, (png_structp png_ptr, + png_infop info_ptr)); + -+PNG_EXPORT(254, png_uint_32, png_get_next_frame_fcTL, ++PNG_EXPORT(256, png_uint_32, png_get_next_frame_fcTL, + (png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, + png_uint_32 *height, png_uint_32 *x_offset, png_uint_32 *y_offset, + png_uint_16 *delay_num, png_uint_16 *delay_den, png_byte *dispose_op, + png_byte *blend_op)); + -+PNG_EXPORT(255, png_uint_32, png_set_next_frame_fcTL, ++PNG_EXPORT(257, png_uint_32, png_set_next_frame_fcTL, + (png_structp png_ptr, png_infop info_ptr, png_uint_32 width, + png_uint_32 height, png_uint_32 x_offset, png_uint_32 y_offset, + png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, + png_byte blend_op)); + -+PNG_EXPORT(256, png_uint_32, png_get_next_frame_width, ++PNG_EXPORT(258, png_uint_32, png_get_next_frame_width, + (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(257, png_uint_32, png_get_next_frame_height, ++PNG_EXPORT(259, png_uint_32, png_get_next_frame_height, + (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(258, png_uint_32, png_get_next_frame_x_offset, ++PNG_EXPORT(260, png_uint_32, png_get_next_frame_x_offset, + (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(259, png_uint_32, png_get_next_frame_y_offset, ++PNG_EXPORT(261, png_uint_32, png_get_next_frame_y_offset, + (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(260, png_uint_16, png_get_next_frame_delay_num, ++PNG_EXPORT(262, png_uint_16, png_get_next_frame_delay_num, + (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(261, png_uint_16, png_get_next_frame_delay_den, ++PNG_EXPORT(263, png_uint_16, png_get_next_frame_delay_den, + (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(262, png_byte, png_get_next_frame_dispose_op, ++PNG_EXPORT(264, png_byte, png_get_next_frame_dispose_op, + (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(263, png_byte, png_get_next_frame_blend_op, ++PNG_EXPORT(265, png_byte, png_get_next_frame_blend_op, + (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(264, png_byte, png_get_first_frame_is_hidden, ++PNG_EXPORT(266, png_byte, png_get_first_frame_is_hidden, + (png_structp png_ptr, png_infop info_ptr)); -+PNG_EXPORT(265, png_uint_32, png_set_first_frame_is_hidden, ++PNG_EXPORT(267, png_uint_32, png_set_first_frame_is_hidden, + (png_structp png_ptr, png_infop info_ptr, png_byte is_hidden)); + +#ifdef PNG_READ_APNG_SUPPORTED -+PNG_EXPORT(266, void, png_read_frame_head, (png_structp png_ptr, ++PNG_EXPORT(268, void, png_read_frame_head, (png_structp png_ptr, + png_infop info_ptr)); +#ifdef PNG_PROGRESSIVE_READ_SUPPORTED -+PNG_EXPORT(267, void, png_set_progressive_frame_fn, (png_structp png_ptr, ++PNG_EXPORT(269, void, png_set_progressive_frame_fn, (png_structp png_ptr, + png_progressive_frame_ptr frame_info_fn, + png_progressive_frame_ptr frame_end_fn)); +#endif /* PROGRESSIVE_READ */ +#endif /* READ_APNG */ + +#ifdef PNG_WRITE_APNG_SUPPORTED -+PNG_EXPORT(268, void, png_write_frame_head, (png_structp png_ptr, ++PNG_EXPORT(270, void, png_write_frame_head, (png_structp png_ptr, + png_infop info_ptr, png_bytepp row_pointers, + png_uint_32 width, png_uint_32 height, + png_uint_32 x_offset, png_uint_32 y_offset, + png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, + png_byte blend_op)); + -+PNG_EXPORT(269, void, png_write_frame_tail, (png_structp png_ptr, ++PNG_EXPORT(271, void, png_write_frame_tail, (png_structp png_ptr, + png_infop info_ptr)); +#endif /* WRITE_APNG */ +#endif /* APNG */ @@ -435,14 +435,14 @@ Index: png.h /* Maintainer: Put new public prototypes here ^, in libpng.3, in project * defs, and in scripts/symbols.def. */ -@@ -3238,7 +3337,11 @@ +@@ -3249,7 +3348,11 @@ * one to use is one more than this.) */ #ifdef PNG_EXPORT_LAST_ORDINAL +#ifdef PNG_APNG_SUPPORTED -+ PNG_EXPORT_LAST_ORDINAL(269); ++ PNG_EXPORT_LAST_ORDINAL(271); +#else - PNG_EXPORT_LAST_ORDINAL(249); + PNG_EXPORT_LAST_ORDINAL(251); +#endif /* APNG */ #endif @@ -451,7 +451,7 @@ Index: pngpriv.h =================================================================== --- a/pngpriv.h +++ b/pngpriv.h -@@ -621,6 +621,10 @@ +@@ -620,6 +620,10 @@ #define PNG_HAVE_CHUNK_AFTER_IDAT 0x2000U /* Have another chunk after IDAT */ #define PNG_WROTE_eXIf 0x4000U #define PNG_IS_READ_STRUCT 0x8000U /* Else is a write struct */ @@ -479,7 +479,7 @@ Index: pngpriv.h /* The following will work on (signed char*) strings, whereas the get_uint_32 * macro will fail on top-bit-set values because of the sign extension. */ -@@ -1642,6 +1656,49 @@ +@@ -1653,6 +1667,49 @@ #endif /* PROGRESSIVE_READ */ @@ -533,7 +533,7 @@ Index: pnginfo.h =================================================================== --- a/pnginfo.h +++ b/pnginfo.h -@@ -263,5 +263,18 @@ +@@ -270,5 +270,18 @@ png_bytepp row_pointers; /* the image bits */ #endif @@ -556,7 +556,7 @@ Index: pngstruct.h =================================================================== --- a/pngstruct.h +++ b/pngstruct.h -@@ -399,6 +399,27 @@ +@@ -398,6 +398,27 @@ png_byte filter_type; #endif @@ -588,7 +588,7 @@ Index: pngwrite.c =================================================================== --- a/pngwrite.c +++ b/pngwrite.c -@@ -128,6 +128,10 @@ +@@ -127,6 +127,10 @@ * the application continues writing the PNG. So check the 'invalid' * flag here too. */ @@ -596,10 +596,10 @@ Index: pngwrite.c + if ((info_ptr->valid & PNG_INFO_acTL) != 0) + png_write_acTL(png_ptr, info_ptr->num_frames, info_ptr->num_plays); +#endif - #ifdef PNG_GAMMA_SUPPORTED - # ifdef PNG_WRITE_gAMA_SUPPORTED - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && -@@ -368,6 +372,11 @@ + #ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED + /* Write unknown chunks first; PNG v3 establishes a precedence order + * for colourspace chunks. It is certain therefore that new +@@ -399,6 +403,11 @@ if ((png_ptr->mode & PNG_HAVE_IDAT) == 0) png_error(png_ptr, "No IDATs written into file"); @@ -611,7 +611,7 @@ Index: pngwrite.c #ifdef PNG_WRITE_CHECK_FOR_INVALID_INDEX_SUPPORTED if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE && png_ptr->num_palette_max >= png_ptr->num_palette) -@@ -2415,4 +2424,42 @@ +@@ -2446,4 +2455,42 @@ } #endif /* SIMPLIFIED_WRITE_STDIO */ #endif /* SIMPLIFIED_WRITE */ @@ -658,7 +658,7 @@ Index: pngpread.c =================================================================== --- a/pngpread.c +++ b/pngpread.c -@@ -195,6 +195,89 @@ +@@ -209,6 +209,89 @@ chunk_name = png_ptr->chunk_name; @@ -748,7 +748,7 @@ Index: pngpread.c if (chunk_name == png_IDAT) { if ((png_ptr->mode & PNG_AFTER_IDAT) != 0) -@@ -261,6 +344,9 @@ +@@ -275,6 +358,9 @@ else if (chunk_name == png_IDAT) { @@ -758,7 +758,7 @@ Index: pngpread.c png_ptr->idat_size = png_ptr->push_length; png_ptr->process_mode = PNG_READ_IDAT_MODE; png_push_have_info(png_ptr, info_ptr); -@@ -415,6 +501,20 @@ +@@ -437,6 +523,20 @@ } #endif @@ -779,7 +779,7 @@ Index: pngpread.c else { PNG_PUSH_SAVE_BUFFER_IF_FULL -@@ -547,7 +647,11 @@ +@@ -569,7 +669,11 @@ png_byte chunk_tag[4]; /* TODO: this code can be commoned up with the same code in push_read */ @@ -791,7 +791,7 @@ Index: pngpread.c png_push_fill_buffer(png_ptr, chunk_length, 4); png_ptr->push_length = png_get_uint_31(png_ptr, chunk_length); png_reset_crc(png_ptr); -@@ -555,17 +659,60 @@ +@@ -577,17 +681,60 @@ png_ptr->chunk_name = PNG_CHUNK_FROM_STRING(chunk_tag); png_ptr->mode |= PNG_HAVE_CHUNK_HEADER; @@ -852,7 +852,7 @@ Index: pngpread.c } if (png_ptr->idat_size != 0 && png_ptr->save_buffer_size != 0) -@@ -639,6 +786,16 @@ +@@ -661,6 +808,16 @@ if (!(buffer_length > 0) || buffer == NULL) png_error(png_ptr, "No IDAT data (internal error)"); @@ -869,7 +869,7 @@ Index: pngpread.c /* This routine must process all the data it has been given * before returning, calling the row callback as required to * handle the uncompressed results. -@@ -1093,6 +1250,18 @@ +@@ -1094,6 +1251,18 @@ png_set_read_fn(png_ptr, progressive_ptr, png_push_fill_buffer); } @@ -892,7 +892,7 @@ Index: pngset.c =================================================================== --- a/pngset.c +++ b/pngset.c -@@ -280,6 +280,11 @@ +@@ -305,6 +305,11 @@ info_ptr->pixel_depth = (png_byte)(info_ptr->channels * info_ptr->bit_depth); info_ptr->rowbytes = PNG_ROWBYTES(info_ptr->pixel_depth, width); @@ -904,7 +904,7 @@ Index: pngset.c } #ifdef PNG_oFFs_SUPPORTED -@@ -1151,6 +1156,146 @@ +@@ -1176,6 +1181,146 @@ } #endif /* sPLT */ @@ -1055,7 +1055,7 @@ Index: pngrutil.c =================================================================== --- a/pngrutil.c +++ b/pngrutil.c -@@ -863,6 +863,11 @@ +@@ -877,6 +877,11 @@ filter_type = buf[11]; interlace_type = buf[12]; @@ -1067,7 +1067,7 @@ Index: pngrutil.c /* Set internal variables */ png_ptr->width = width; png_ptr->height = height; -@@ -2857,6 +2862,180 @@ +@@ -2912,6 +2917,180 @@ } #endif @@ -1248,7 +1248,7 @@ Index: pngrutil.c #ifdef PNG_READ_UNKNOWN_CHUNKS_SUPPORTED /* Utility function for png_handle_unknown; set up png_ptr::unknown_chunk */ static int -@@ -3162,7 +3341,11 @@ +@@ -3217,7 +3366,11 @@ if (PNG_USER_CHUNK_MALLOC_MAX < limit) limit = PNG_USER_CHUNK_MALLOC_MAX; # endif @@ -1260,7 +1260,7 @@ Index: pngrutil.c { png_alloc_size_t idat_limit = PNG_UINT_31_MAX; size_t row_factor = -@@ -4166,6 +4349,38 @@ +@@ -4217,6 +4400,38 @@ uInt avail_in; png_bytep buffer; @@ -1299,7 +1299,7 @@ Index: pngrutil.c while (png_ptr->idat_size == 0) { png_crc_finish(png_ptr, 0); -@@ -4177,6 +4392,7 @@ +@@ -4228,6 +4443,7 @@ if (png_ptr->chunk_name != png_IDAT) png_error(png_ptr, "Not enough image data"); } @@ -1307,7 +1307,7 @@ Index: pngrutil.c avail_in = png_ptr->IDAT_read_size; -@@ -4240,6 +4456,9 @@ +@@ -4291,6 +4507,9 @@ png_ptr->mode |= PNG_AFTER_IDAT; png_ptr->flags |= PNG_FLAG_ZSTREAM_ENDED; @@ -1317,7 +1317,7 @@ Index: pngrutil.c if (png_ptr->zstream.avail_in > 0 || png_ptr->idat_size > 0) png_chunk_benign_error(png_ptr, "Extra compressed data"); -@@ -4677,4 +4896,80 @@ +@@ -4700,4 +4919,80 @@ png_ptr->flags |= PNG_FLAG_ROW_INIT; } @@ -1402,7 +1402,7 @@ Index: pngwutil.c =================================================================== --- a/pngwutil.c +++ b/pngwutil.c -@@ -821,6 +821,11 @@ +@@ -838,6 +838,11 @@ /* Write the chunk */ png_write_complete_chunk(png_ptr, png_IHDR, buf, 13); @@ -1414,7 +1414,7 @@ Index: pngwutil.c if ((png_ptr->do_filter) == PNG_NO_FILTERS) { if (png_ptr->color_type == PNG_COLOR_TYPE_PALETTE || -@@ -1003,7 +1008,17 @@ +@@ -1020,7 +1025,17 @@ #endif if (size > 0) @@ -1432,7 +1432,7 @@ Index: pngwutil.c png_ptr->mode |= PNG_HAVE_IDAT; png_ptr->zstream.next_out = data; -@@ -1050,7 +1065,17 @@ +@@ -1067,7 +1082,17 @@ #endif if (size > 0) @@ -1450,7 +1450,7 @@ Index: pngwutil.c png_ptr->zstream.avail_out = 0; png_ptr->zstream.next_out = NULL; png_ptr->mode |= PNG_HAVE_IDAT | PNG_AFTER_IDAT; -@@ -1885,6 +1910,82 @@ +@@ -1925,6 +1950,82 @@ } #endif @@ -1573,4 +1573,3 @@ Index: pngwutil.c +} +#endif /* WRITE_APNG */ #endif /* WRITE */ - diff --git a/contrib/libs/libpng/png.c b/contrib/libs/libpng/png.c index 9a9fb23d94..466af7d992 100644 --- a/contrib/libs/libpng/png.c +++ b/contrib/libs/libpng/png.c @@ -1,7 +1,6 @@ - /* png.c - location for general purpose libpng functions * - * Copyright (c) 2018-2024 Cosmin Truta + * Copyright (c) 2018-2025 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson * Copyright (c) 1996-1997 Andreas Dilger * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. @@ -14,7 +13,7 @@ #include "pngpriv.h" /* Generate a compiler error if there is an old png.h in the search path. */ -typedef png_libpng_version_1_6_44 Your_png_h_is_not_version_1_6_44; +typedef png_libpng_version_1_6_45 Your_png_h_is_not_version_1_6_45; /* 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 @@ -794,8 +793,8 @@ png_get_copyright(png_const_structrp png_ptr) return PNG_STRING_COPYRIGHT #else return PNG_STRING_NEWLINE \ - "libpng version 1.6.44" PNG_STRING_NEWLINE \ - "Copyright (c) 2018-2024 Cosmin Truta" PNG_STRING_NEWLINE \ + "libpng version 1.6.45" PNG_STRING_NEWLINE \ + "Copyright (c) 2018-2025 Cosmin Truta" PNG_STRING_NEWLINE \ "Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson" \ PNG_STRING_NEWLINE \ "Copyright (c) 1996-1997 Andreas Dilger" PNG_STRING_NEWLINE \ @@ -1203,22 +1202,66 @@ 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. +static png_int_32 +png_fp_add(png_int_32 addend0, png_int_32 addend1, int *error) +{ + /* Safely add two fixed point values setting an error flag and returning 0.5 + * on overflow. * 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; + if (addend0 > 0) + { + if (0x7fffffff - addend0 >= addend1) + return addend0+addend1; + } + else if (addend0 < 0) + { + if (-0x7fffffff - addend0 <= addend1) + return addend0+addend1; + } + else + return addend1; + + *error = 1; + return PNG_FP_1/2; +} + +static png_int_32 +png_fp_sub(png_int_32 addend0, png_int_32 addend1, int *error) +{ + /* As above but calculate addend0-addend1. */ + if (addend1 > 0) + { + if (-0x7fffffff + addend1 <= addend0) + return addend0-addend1; + } + else if (addend1 < 0) + { + if (0x7fffffff + addend1 >= addend0) + return addend0-addend1; + } + else + return addend0; + + *error = 1; + return PNG_FP_1/2; +} + +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 overflow. Does not + * set the result on overflow. + */ + int error = 0; + int result = png_fp_add(*addend0_and_result, + png_fp_add(addend1, addend2, &error), + &error); + if (!error) *addend0_and_result = result; + return error; } /* Added at libpng-1.5.5 to support read and write of true CIEXYZ values for @@ -1229,7 +1272,7 @@ png_safe_add(png_int_32 *addend0_and_result, png_int_32 addend1, static int png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ) { - png_int_32 d, dred, dgreen, dwhite, whiteX, whiteY; + png_int_32 d, dred, dgreen, dblue, dwhite, whiteX, whiteY; /* '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). @@ -1237,44 +1280,52 @@ png_xy_from_XYZ(png_xy *xy, const png_XYZ *XYZ) 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) + dred = d; + if (png_muldiv(&xy->redx, XYZ->red_X, PNG_FP_1, dred) == 0) return 1; - if (png_muldiv(&xy->redy, XYZ->red_Y, PNG_FP_1, d) == 0) + if (png_muldiv(&xy->redy, XYZ->red_Y, PNG_FP_1, dred) == 0) return 1; - dred = d; - whiteX = XYZ->red_X; - whiteY = XYZ->red_Y; 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) + dgreen = d; + if (png_muldiv(&xy->greenx, XYZ->green_X, PNG_FP_1, dgreen) == 0) return 1; - if (png_muldiv(&xy->greeny, XYZ->green_Y, PNG_FP_1, d) == 0) + if (png_muldiv(&xy->greeny, XYZ->green_Y, PNG_FP_1, dgreen) == 0) return 1; - dgreen = d; - whiteX += XYZ->green_X; - whiteY += XYZ->green_Y; 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) + dblue = d; + if (png_muldiv(&xy->bluex, XYZ->blue_X, PNG_FP_1, dblue) == 0) return 1; - if (png_muldiv(&xy->bluey, XYZ->blue_Y, PNG_FP_1, d) == 0) + if (png_muldiv(&xy->bluey, XYZ->blue_Y, PNG_FP_1, dblue) == 0) return 1; - whiteX += XYZ->blue_X; - whiteY += XYZ->blue_Y; /* 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: */ + d = dblue; if (png_safe_add(&d, dred, dgreen)) return 1; - dwhite = d; + /* Find the white X,Y values from the sum of the red, green and blue X,Y + * values. + */ + d = XYZ->red_X; + if (png_safe_add(&d, XYZ->green_X, XYZ->blue_X)) + return 1; + whiteX = d; + + d = XYZ->red_Y; + if (png_safe_add(&d, XYZ->green_Y, XYZ->blue_Y)) + return 1; + whiteY = 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) @@ -1289,6 +1340,29 @@ 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. + * + * The limits here will *not* accept ACES AP0, where bluey is -7700 + * (-0.0770) because the PNG spec itself requires the xy values to be + * unsigned. whitey is also required to be 5 or more to avoid overflow. + * + * Instead the upper limits have been relaxed to accomodate ACES AP1 where + * redz ends up as -600 (-0.006). ProPhotoRGB was already "in range." + * The new limit accomodates the AP0 and AP1 ranges for z but not AP0 redy. + */ + const png_fixed_point fpLimit = PNG_FP_1+(PNG_FP_1/10); + if (xy->redx < 0 || xy->redx > fpLimit) return 1; + if (xy->redy < 0 || xy->redy > fpLimit-xy->redx) return 1; + if (xy->greenx < 0 || xy->greenx > fpLimit) return 1; + if (xy->greeny < 0 || xy->greeny > fpLimit-xy->greenx) return 1; + if (xy->bluex < 0 || xy->bluex > fpLimit) return 1; + if (xy->bluey < 0 || xy->bluey > fpLimit-xy->bluex) return 1; + if (xy->whitex < 0 || xy->whitex > fpLimit) return 1; + if (xy->whitey < 5 || xy->whitey > fpLimit-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; @@ -1432,18 +1506,23 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy) * (green-x - blue-x)*(red-y - blue-y)-(green-y - blue-y)*(red-x - blue-x) * * Accuracy: - * The input values have 5 decimal digits of accuracy. The values are all in - * the range 0 < value < 1, so simple products are in the same range but may - * need up to 10 decimal digits to preserve the original precision and avoid - * underflow. Because we are using a 32-bit signed representation we cannot - * match this; the best is a little over 9 decimal digits, less than 10. + * The input values have 5 decimal digits of accuracy. + * + * In the previous implementation the values were all in the range 0 < value + * < 1, so simple products are in the same range but may need up to 10 + * decimal digits to preserve the original precision and avoid underflow. + * Because we are using a 32-bit signed representation we cannot match this; + * the best is a little over 9 decimal digits, less than 10. + * + * This range has now been extended to allow values up to 1.1, or 110,000 in + * fixed point. * * The approach used here is to preserve the maximum precision within the * signed representation. Because the red-scale calculation above uses the - * difference between two products of values that must be in the range -1..+1 - * it is sufficient to divide the product by 7; ceil(100,000/32767*2). The - * factor is irrelevant in the calculation because it is applied to both - * numerator and denominator. + * difference between two products of values that must be in the range + * -1.1..+1.1 it is sufficient to divide the product by 8; + * ceil(121,000/32767*2). The factor is irrelevant in the calculation + * because it is applied to both numerator and denominator. * * Note that the values of the differences of the products of the * chromaticities in the above equations tend to be small, for example for @@ -1465,19 +1544,25 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy) * Adobe Wide Gamut RGB * 0.258728243040113 0.724682314948566 0.016589442011321 */ - /* By the argument, above overflow should be impossible here. The return - * value of 2 indicates an internal error to the caller. + int error = 0; + + /* By the argument above overflow should be impossible here, however the + * code now simply returns a failure code. The xy subtracts in the arguments + * to png_muldiv are *not* checked for overflow because the checks at the + * start guarantee they are in the range 0..110000 and png_fixed_point is a + * 32-bit signed number. */ - if (png_muldiv(&left, xy->greenx-xy->bluex, xy->redy - xy->bluey, 7) == 0) + if (png_muldiv(&left, xy->greenx-xy->bluex, xy->redy - xy->bluey, 8) == 0) return 1; - if (png_muldiv(&right, xy->greeny-xy->bluey, xy->redx - xy->bluex, 7) == 0) + if (png_muldiv(&right, xy->greeny-xy->bluey, xy->redx - xy->bluex, 8) == 0) return 1; - denominator = left - right; + denominator = png_fp_sub(left, right, &error); + if (error) return 1; /* Now find the red numerator. */ - if (png_muldiv(&left, xy->greenx-xy->bluex, xy->whitey-xy->bluey, 7) == 0) + if (png_muldiv(&left, xy->greenx-xy->bluex, xy->whitey-xy->bluey, 8) == 0) return 1; - if (png_muldiv(&right, xy->greeny-xy->bluey, xy->whitex-xy->bluex, 7) == 0) + if (png_muldiv(&right, xy->greeny-xy->bluey, xy->whitex-xy->bluex, 8) == 0) return 1; /* Overflow is possible here and it indicates an extreme set of PNG cHRM @@ -1485,29 +1570,35 @@ png_XYZ_from_xy(png_XYZ *XYZ, const png_xy *xy) * scale value because this allows us to delay the multiplication of white-y * into the denominator, which tends to produce a small number. */ - if (png_muldiv(&red_inverse, xy->whitey, denominator, left-right) == 0 || + if (png_muldiv(&red_inverse, xy->whitey, denominator, + png_fp_sub(left, right, &error)) == 0 || error || red_inverse <= xy->whitey /* r+g+b scales = white scale */) return 1; /* Similarly for green_inverse: */ - if (png_muldiv(&left, xy->redy-xy->bluey, xy->whitex-xy->bluex, 7) == 0) + if (png_muldiv(&left, xy->redy-xy->bluey, xy->whitex-xy->bluex, 8) == 0) return 1; - if (png_muldiv(&right, xy->redx-xy->bluex, xy->whitey-xy->bluey, 7) == 0) + if (png_muldiv(&right, xy->redx-xy->bluex, xy->whitey-xy->bluey, 8) == 0) return 1; - if (png_muldiv(&green_inverse, xy->whitey, denominator, left-right) == 0 || + if (png_muldiv(&green_inverse, xy->whitey, denominator, + png_fp_sub(left, right, &error)) == 0 || error || green_inverse <= xy->whitey) return 1; /* And the blue scale, the checks above guarantee this can't overflow but it * can still produce 0 for extreme cHRM values. */ - blue_scale = png_reciprocal(xy->whitey) - png_reciprocal(red_inverse) - - png_reciprocal(green_inverse); - if (blue_scale <= 0) + blue_scale = png_fp_sub(png_fp_sub(png_reciprocal(xy->whitey), + png_reciprocal(red_inverse), &error), + png_reciprocal(green_inverse), &error); + if (error || blue_scale <= 0) return 1; - /* And fill in the png_XYZ: */ + /* And fill in the png_XYZ. Again the subtracts are safe because of the + * checks on the xy values at the start (the subtracts just calculate the + * corresponding z values.) + */ if (png_muldiv(&XYZ->red_X, xy->redx, PNG_FP_1, red_inverse) == 0) return 1; if (png_muldiv(&XYZ->red_Y, xy->redy, PNG_FP_1, red_inverse) == 0) diff --git a/contrib/libs/libpng/png.h b/contrib/libs/libpng/png.h index 8cd8f041e0..41e823bde5 100644 --- a/contrib/libs/libpng/png.h +++ b/contrib/libs/libpng/png.h @@ -1,9 +1,8 @@ - /* png.h - header file for PNG reference library * - * libpng version 1.6.44 + * libpng version 1.6.45 * - * Copyright (c) 2018-2024 Cosmin Truta + * Copyright (c) 2018-2025 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson * Copyright (c) 1996-1997 Andreas Dilger * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. @@ -15,7 +14,7 @@ * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger * libpng versions 0.97, January 1998, through 1.6.35, July 2018: * Glenn Randers-Pehrson - * libpng versions 1.6.36, December 2018, through 1.6.44, September 2024: + * libpng versions 1.6.36, December 2018, through 1.6.45, January 2025: * Cosmin Truta * See also "Contributing Authors", below. */ @@ -26,15 +25,15 @@ * * This modified version of libpng code adds animated PNG support and is * released under the libpng license described below. The modifications are - * Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2024 Max Stepin, + * Copyright (c) 2006-2007 Andrew Smith, Copyright (c) 2008-2025 Max Stepin, * and are delimited by "#ifdef PNG_APNG_SUPPORTED / #endif" directives * surrounding them in the modified libpng source files. * * PNG Reference Library License version 2 * --------------------------------------- * - * * Copyright (c) 1995-2024 The PNG Reference Library Authors. - * * Copyright (c) 2018-2024 Cosmin Truta. + * * Copyright (c) 1995-2025 The PNG Reference Library Authors. + * * Copyright (c) 2018-2025 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 +244,7 @@ * ... * 1.5.30 15 10530 15.so.15.30[.0] * ... - * 1.6.44 16 10644 16.so.16.44[.0] + * 1.6.45 16 10645 16.so.16.45[.0] * * Henceforth the source version will match the shared-library major and * minor numbers; the shared-library major version number will be used for @@ -281,7 +280,7 @@ */ /* Version information for png.h - this should match the version in png.c */ -#define PNG_LIBPNG_VER_STRING "1.6.44" +#define PNG_LIBPNG_VER_STRING "1.6.45" #define PNG_HEADER_VERSION_STRING " libpng version " PNG_LIBPNG_VER_STRING "\n" /* The versions of shared library builds should stay in sync, going forward */ @@ -292,7 +291,7 @@ /* These should match the first 3 components of PNG_LIBPNG_VER_STRING: */ #define PNG_LIBPNG_VER_MAJOR 1 #define PNG_LIBPNG_VER_MINOR 6 -#define PNG_LIBPNG_VER_RELEASE 44 +#define PNG_LIBPNG_VER_RELEASE 45 /* This should be zero for a public release, or non-zero for a * development version. @@ -323,7 +322,7 @@ * From version 1.0.1 it is: * XXYYZZ, where XX=major, YY=minor, ZZ=release */ -#define PNG_LIBPNG_VER 10644 /* 1.6.44 */ +#define PNG_LIBPNG_VER 10645 /* 1.6.45 */ /* Library configuration: these options cannot be changed after * the library has been built. @@ -448,7 +447,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_44; +typedef char* png_libpng_version_1_6_45; /* Basic control structions. Read libpng-manual.txt or libpng.3 for more info. * @@ -766,9 +765,10 @@ typedef png_unknown_chunk * * png_unknown_chunkpp; #define PNG_INFO_sCAL 0x4000U /* ESR, 1.0.6 */ #define PNG_INFO_IDAT 0x8000U /* ESR, 1.0.6 */ #define PNG_INFO_eXIf 0x10000U /* GR-P, 1.6.31 */ +#define PNG_INFO_cICP 0x20000U #ifdef PNG_APNG_SUPPORTED -#define PNG_INFO_acTL 0x20000U -#define PNG_INFO_fcTL 0x40000U +#define PNG_INFO_acTL 0x40000U +#define PNG_INFO_fcTL 0x80000U #endif /* This is used for the transformation routines, as some of them @@ -2003,6 +2003,17 @@ PNG_FIXED_EXPORT(233, void, png_set_cHRM_XYZ_fixed, (png_const_structrp png_ptr, png_fixed_point int_blue_Z)) #endif +#ifdef PNG_cICP_SUPPORTED +PNG_EXPORT(250, png_uint_32, png_get_cICP, (png_const_structrp png_ptr, + png_inforp info_ptr, png_bytep colour_primaries, + png_bytep transfer_function, png_bytep matrix_coefficients, + png_bytep video_full_range_flag)); +PNG_EXPORT(251, void, png_set_cICP, (png_const_structrp png_ptr, + png_inforp info_ptr, png_byte colour_primaries, + png_byte transfer_function, png_byte matrix_coefficients, + png_byte video_full_range_flag)); +#endif + #ifdef PNG_eXIf_SUPPORTED PNG_EXPORT(246, png_uint_32, png_get_eXIf, (png_const_structrp png_ptr, png_inforp info_ptr, png_bytep *exif)); @@ -3260,70 +3271,70 @@ PNG_EXPORT(244, int, png_set_option, (png_structrp png_ptr, int option, ******************************************************************************/ #ifdef PNG_APNG_SUPPORTED -PNG_EXPORT(250, png_uint_32, png_get_acTL, (png_structp png_ptr, +PNG_EXPORT(252, png_uint_32, png_get_acTL, (png_structp png_ptr, png_infop info_ptr, png_uint_32 *num_frames, png_uint_32 *num_plays)); -PNG_EXPORT(251, png_uint_32, png_set_acTL, (png_structp png_ptr, +PNG_EXPORT(253, png_uint_32, png_set_acTL, (png_structp png_ptr, png_infop info_ptr, png_uint_32 num_frames, png_uint_32 num_plays)); -PNG_EXPORT(252, png_uint_32, png_get_num_frames, (png_structp png_ptr, +PNG_EXPORT(254, png_uint_32, png_get_num_frames, (png_structp png_ptr, png_infop info_ptr)); -PNG_EXPORT(253, png_uint_32, png_get_num_plays, (png_structp png_ptr, +PNG_EXPORT(255, png_uint_32, png_get_num_plays, (png_structp png_ptr, png_infop info_ptr)); -PNG_EXPORT(254, png_uint_32, png_get_next_frame_fcTL, +PNG_EXPORT(256, png_uint_32, png_get_next_frame_fcTL, (png_structp png_ptr, png_infop info_ptr, png_uint_32 *width, png_uint_32 *height, png_uint_32 *x_offset, png_uint_32 *y_offset, png_uint_16 *delay_num, png_uint_16 *delay_den, png_byte *dispose_op, png_byte *blend_op)); -PNG_EXPORT(255, png_uint_32, png_set_next_frame_fcTL, +PNG_EXPORT(257, png_uint_32, png_set_next_frame_fcTL, (png_structp png_ptr, png_infop info_ptr, png_uint_32 width, png_uint_32 height, png_uint_32 x_offset, png_uint_32 y_offset, png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, png_byte blend_op)); -PNG_EXPORT(256, png_uint_32, png_get_next_frame_width, +PNG_EXPORT(258, png_uint_32, png_get_next_frame_width, (png_structp png_ptr, png_infop info_ptr)); -PNG_EXPORT(257, png_uint_32, png_get_next_frame_height, +PNG_EXPORT(259, png_uint_32, png_get_next_frame_height, (png_structp png_ptr, png_infop info_ptr)); -PNG_EXPORT(258, png_uint_32, png_get_next_frame_x_offset, +PNG_EXPORT(260, png_uint_32, png_get_next_frame_x_offset, (png_structp png_ptr, png_infop info_ptr)); -PNG_EXPORT(259, png_uint_32, png_get_next_frame_y_offset, +PNG_EXPORT(261, png_uint_32, png_get_next_frame_y_offset, (png_structp png_ptr, png_infop info_ptr)); -PNG_EXPORT(260, png_uint_16, png_get_next_frame_delay_num, +PNG_EXPORT(262, png_uint_16, png_get_next_frame_delay_num, (png_structp png_ptr, png_infop info_ptr)); -PNG_EXPORT(261, png_uint_16, png_get_next_frame_delay_den, +PNG_EXPORT(263, png_uint_16, png_get_next_frame_delay_den, (png_structp png_ptr, png_infop info_ptr)); -PNG_EXPORT(262, png_byte, png_get_next_frame_dispose_op, +PNG_EXPORT(264, png_byte, png_get_next_frame_dispose_op, (png_structp png_ptr, png_infop info_ptr)); -PNG_EXPORT(263, png_byte, png_get_next_frame_blend_op, +PNG_EXPORT(265, png_byte, png_get_next_frame_blend_op, (png_structp png_ptr, png_infop info_ptr)); -PNG_EXPORT(264, png_byte, png_get_first_frame_is_hidden, +PNG_EXPORT(266, png_byte, png_get_first_frame_is_hidden, (png_structp png_ptr, png_infop info_ptr)); -PNG_EXPORT(265, png_uint_32, png_set_first_frame_is_hidden, +PNG_EXPORT(267, png_uint_32, png_set_first_frame_is_hidden, (png_structp png_ptr, png_infop info_ptr, png_byte is_hidden)); #ifdef PNG_READ_APNG_SUPPORTED -PNG_EXPORT(266, void, png_read_frame_head, (png_structp png_ptr, +PNG_EXPORT(268, void, png_read_frame_head, (png_structp png_ptr, png_infop info_ptr)); #ifdef PNG_PROGRESSIVE_READ_SUPPORTED -PNG_EXPORT(267, void, png_set_progressive_frame_fn, (png_structp png_ptr, +PNG_EXPORT(269, void, png_set_progressive_frame_fn, (png_structp png_ptr, png_progressive_frame_ptr frame_info_fn, png_progressive_frame_ptr frame_end_fn)); #endif /* PROGRESSIVE_READ */ #endif /* READ_APNG */ #ifdef PNG_WRITE_APNG_SUPPORTED -PNG_EXPORT(268, void, png_write_frame_head, (png_structp png_ptr, +PNG_EXPORT(270, void, png_write_frame_head, (png_structp png_ptr, png_infop info_ptr, png_bytepp row_pointers, png_uint_32 width, png_uint_32 height, png_uint_32 x_offset, png_uint_32 y_offset, png_uint_16 delay_num, png_uint_16 delay_den, png_byte dispose_op, png_byte blend_op)); -PNG_EXPORT(269, void, png_write_frame_tail, (png_structp png_ptr, +PNG_EXPORT(271, void, png_write_frame_tail, (png_structp png_ptr, png_infop info_ptr)); #endif /* WRITE_APNG */ #endif /* APNG */ @@ -3337,9 +3348,9 @@ PNG_EXPORT(269, void, png_write_frame_tail, (png_structp png_ptr, */ #ifdef PNG_EXPORT_LAST_ORDINAL #ifdef PNG_APNG_SUPPORTED - PNG_EXPORT_LAST_ORDINAL(269); + PNG_EXPORT_LAST_ORDINAL(271); #else - PNG_EXPORT_LAST_ORDINAL(249); + PNG_EXPORT_LAST_ORDINAL(251); #endif /* APNG */ #endif diff --git a/contrib/libs/libpng/pngconf.h b/contrib/libs/libpng/pngconf.h index 4a4b58ac81..11a40b8d81 100644 --- a/contrib/libs/libpng/pngconf.h +++ b/contrib/libs/libpng/pngconf.h @@ -1,9 +1,8 @@ - /* pngconf.h - machine-configurable file for libpng * - * libpng version 1.6.44 + * libpng version 1.6.45 * - * Copyright (c) 2018-2024 Cosmin Truta + * Copyright (c) 2018-2025 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2016,2018 Glenn Randers-Pehrson * Copyright (c) 1996-1997 Andreas Dilger * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. diff --git a/contrib/libs/libpng/pngdebug.h b/contrib/libs/libpng/pngdebug.h index 00d5a4569e..ab9ea632d9 100644 --- a/contrib/libs/libpng/pngdebug.h +++ b/contrib/libs/libpng/pngdebug.h @@ -1,4 +1,3 @@ - /* pngdebug.h - Debugging macros for libpng, also used in pngtest.c * * Copyright (c) 2018 Cosmin Truta diff --git a/contrib/libs/libpng/pngerror.c b/contrib/libs/libpng/pngerror.c index 1babf9f8d2..aa0ae58e15 100644 --- a/contrib/libs/libpng/pngerror.c +++ b/contrib/libs/libpng/pngerror.c @@ -1,4 +1,3 @@ - /* pngerror.c - stub functions for i/o and memory allocation * * Copyright (c) 2018-2024 Cosmin Truta diff --git a/contrib/libs/libpng/pngget.c b/contrib/libs/libpng/pngget.c index 9c7977b287..5f668283d0 100644 --- a/contrib/libs/libpng/pngget.c +++ b/contrib/libs/libpng/pngget.c @@ -1,4 +1,3 @@ - /* pngget.c - retrieval of values from info struct * * Copyright (c) 2018-2024 Cosmin Truta @@ -785,6 +784,31 @@ png_get_sPLT(png_const_structrp png_ptr, png_inforp info_ptr, } #endif +#ifdef PNG_cICP_SUPPORTED +png_uint_32 PNGAPI +png_get_cICP(png_const_structrp png_ptr, + png_inforp info_ptr, png_bytep colour_primaries, + png_bytep transfer_function, png_bytep matrix_coefficients, + png_bytep video_full_range_flag) +{ + png_debug1(1, "in %s retrieval function", "cICP"); + + if (png_ptr != NULL && info_ptr != NULL && + (info_ptr->valid & PNG_INFO_cICP) != 0 && + colour_primaries != NULL && transfer_function != NULL && + matrix_coefficients != NULL && video_full_range_flag != NULL) + { + *colour_primaries = info_ptr->cicp_colour_primaries; + *transfer_function = info_ptr->cicp_transfer_function; + *matrix_coefficients = info_ptr->cicp_matrix_coefficients; + *video_full_range_flag = info_ptr->cicp_video_full_range_flag; + return (PNG_INFO_cICP); + } + + return (0); +} +#endif + #ifdef PNG_eXIf_SUPPORTED png_uint_32 PNGAPI png_get_eXIf(png_const_structrp png_ptr, png_inforp info_ptr, diff --git a/contrib/libs/libpng/pnginfo.h b/contrib/libs/libpng/pnginfo.h index ac7b269132..8249270873 100644 --- a/contrib/libs/libpng/pnginfo.h +++ b/contrib/libs/libpng/pnginfo.h @@ -1,4 +1,3 @@ - /* pnginfo.h - header file for PNG reference library * * Copyright (c) 2018 Cosmin Truta @@ -101,6 +100,14 @@ struct png_info_def png_colorspace colorspace; #endif +#ifdef PNG_cICP_SUPPORTED + /* cICP chunk data */ + png_byte cicp_colour_primaries; + png_byte cicp_transfer_function; + png_byte cicp_matrix_coefficients; + png_byte cicp_video_full_range_flag; +#endif + #ifdef PNG_iCCP_SUPPORTED /* iCCP chunk data. */ png_charp iccp_name; /* profile name */ diff --git a/contrib/libs/libpng/pnglibconf.h b/contrib/libs/libpng/pnglibconf.h index 5bd9b122af..dbf04d03a2 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.44 */ +/* libpng version 1.6.45 */ -/* Copyright (c) 2018-2024 Cosmin Truta */ +/* Copyright (c) 2018-2025 Cosmin Truta */ /* Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson */ /* This code is released under the libpng license. */ @@ -88,6 +88,7 @@ #define PNG_READ_USER_TRANSFORM_SUPPORTED #define PNG_READ_bKGD_SUPPORTED #define PNG_READ_cHRM_SUPPORTED +#define PNG_READ_cICP_SUPPORTED #define PNG_READ_eXIf_SUPPORTED #define PNG_READ_gAMA_SUPPORTED #define PNG_READ_hIST_SUPPORTED @@ -158,6 +159,7 @@ #define PNG_WRITE_WEIGHTED_FILTER_SUPPORTED #define PNG_WRITE_bKGD_SUPPORTED #define PNG_WRITE_cHRM_SUPPORTED +#define PNG_WRITE_cICP_SUPPORTED #define PNG_WRITE_eXIf_SUPPORTED #define PNG_WRITE_gAMA_SUPPORTED #define PNG_WRITE_hIST_SUPPORTED @@ -176,6 +178,7 @@ #define PNG_WRITE_zTXt_SUPPORTED #define PNG_bKGD_SUPPORTED #define PNG_cHRM_SUPPORTED +#define PNG_cICP_SUPPORTED #define PNG_eXIf_SUPPORTED #define PNG_gAMA_SUPPORTED #define PNG_hIST_SUPPORTED diff --git a/contrib/libs/libpng/pngmem.c b/contrib/libs/libpng/pngmem.c index 09ed9c1c99..d391c13ff4 100644 --- a/contrib/libs/libpng/pngmem.c +++ b/contrib/libs/libpng/pngmem.c @@ -1,4 +1,3 @@ - /* pngmem.c - stub functions for memory allocation * * Copyright (c) 2018 Cosmin Truta diff --git a/contrib/libs/libpng/pngpread.c b/contrib/libs/libpng/pngpread.c index 826d879cb2..ff08dcbb2e 100644 --- a/contrib/libs/libpng/pngpread.c +++ b/contrib/libs/libpng/pngpread.c @@ -1,4 +1,3 @@ - /* pngpread.c - read a png file in push mode * * Copyright (c) 2018-2024 Cosmin Truta @@ -32,6 +31,21 @@ if (png_ptr->push_length + 4 > png_ptr->buffer_size) \ if (png_ptr->buffer_size < N) \ { png_push_save_buffer(png_ptr); return; } +#ifdef PNG_READ_INTERLACING_SUPPORTED +/* Arrays to facilitate interlacing - use pass (0 - 6) as index. */ + +/* Start of interlace block */ +static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; +/* Offset to next interlace block */ +static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; +/* Start of interlace block in the y direction */ +static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; +/* Offset to next interlace block in the y direction */ +static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + +/* TODO: Move these arrays to a common utility module to avoid duplication. */ +#endif + void PNGAPI png_process_data(png_structrp png_ptr, png_inforp info_ptr, png_bytep buffer, size_t buffer_size) @@ -381,6 +395,14 @@ png_push_read_chunk(png_structrp png_ptr, png_inforp info_ptr) } #endif +#ifdef PNG_READ_cICP_SUPPORTED + else if (png_ptr->chunk_name == png_cICP) + { + PNG_PUSH_SAVE_BUFFER_IF_FULL + png_handle_cICP(png_ptr, info_ptr, png_ptr->push_length); + } + +#endif #ifdef PNG_READ_eXIf_SUPPORTED else if (png_ptr->chunk_name == png_eXIf) { @@ -1133,27 +1155,6 @@ png_push_process_row(png_structrp png_ptr) void /* PRIVATE */ png_read_push_finish_row(png_structrp png_ptr) { -#ifdef PNG_READ_INTERLACING_SUPPORTED - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - static const png_byte png_pass_start[] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - static const png_byte png_pass_inc[] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - static const png_byte png_pass_ystart[] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - static const png_byte png_pass_yinc[] = {8, 8, 8, 4, 4, 2, 2}; - - /* Height of interlace block. This is not currently used - if you need - * it, uncomment it here and in png.h - static const png_byte png_pass_height[] = {8, 8, 4, 4, 2, 2, 1}; - */ -#endif - png_ptr->row_number++; if (png_ptr->row_number < png_ptr->num_rows) return; diff --git a/contrib/libs/libpng/pngpriv.h b/contrib/libs/libpng/pngpriv.h index eccafd8d2d..60a3a060d4 100644 --- a/contrib/libs/libpng/pngpriv.h +++ b/contrib/libs/libpng/pngpriv.h @@ -1,4 +1,3 @@ - /* pngpriv.h - private declarations for use inside libpng * * Copyright (c) 2018-2024 Cosmin Truta @@ -839,6 +838,7 @@ #define png_PLTE PNG_U32( 80, 76, 84, 69) #define png_bKGD PNG_U32( 98, 75, 71, 68) #define png_cHRM PNG_U32( 99, 72, 82, 77) +#define png_cICP PNG_U32( 99, 73, 67, 80) #define png_eXIf PNG_U32(101, 88, 73, 102) /* registered July 2017 */ #define png_fRAc PNG_U32(102, 82, 65, 99) /* registered, not defined */ #define png_gAMA PNG_U32(103, 65, 77, 65) @@ -1145,6 +1145,12 @@ PNG_INTERNAL_FUNCTION(void,png_write_cHRM_fixed,(png_structrp png_ptr, /* The xy value must have been previously validated */ #endif +#ifdef PNG_WRITE_cICP_SUPPORTED +PNG_INTERNAL_FUNCTION(void,png_write_cICP,(png_structrp png_ptr, + png_byte colour_primaries, png_byte transfer_function, + png_byte matrix_coefficients, png_byte video_full_range_flag), PNG_EMPTY); +#endif + #ifdef PNG_WRITE_sRGB_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_write_sRGB,(png_structrp png_ptr, int intent),PNG_EMPTY); @@ -1488,6 +1494,11 @@ PNG_INTERNAL_FUNCTION(void,png_handle_cHRM,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); #endif +#ifdef PNG_READ_cICP_SUPPORTED +PNG_INTERNAL_FUNCTION(void,png_handle_cICP,(png_structrp png_ptr, + png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); +#endif + #ifdef PNG_READ_eXIf_SUPPORTED PNG_INTERNAL_FUNCTION(void,png_handle_eXIf,(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length),PNG_EMPTY); diff --git a/contrib/libs/libpng/pngread.c b/contrib/libs/libpng/pngread.c index 26c8d00ecc..4fb4009117 100644 --- a/contrib/libs/libpng/pngread.c +++ b/contrib/libs/libpng/pngread.c @@ -1,7 +1,6 @@ - /* pngread.c - read a PNG file * - * Copyright (c) 2018-2024 Cosmin Truta + * Copyright (c) 2018-2025 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson * Copyright (c) 1996-1997 Andreas Dilger * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. @@ -178,6 +177,11 @@ png_read_info(png_structrp png_ptr, png_inforp info_ptr) png_handle_cHRM(png_ptr, info_ptr, length); #endif +#ifdef PNG_READ_cICP_SUPPORTED + else if (chunk_name == png_cICP) + png_handle_cICP(png_ptr, info_ptr, length); +#endif + #ifdef PNG_READ_eXIf_SUPPORTED else if (chunk_name == png_eXIf) png_handle_eXIf(png_ptr, info_ptr, length); @@ -932,6 +936,11 @@ png_read_end(png_structrp png_ptr, png_inforp info_ptr) png_handle_cHRM(png_ptr, info_ptr, length); #endif +#ifdef PNG_READ_cICP_SUPPORTED + else if (chunk_name == png_cICP) + png_handle_cICP(png_ptr, info_ptr, length); +#endif + #ifdef PNG_READ_eXIf_SUPPORTED else if (chunk_name == png_eXIf) png_handle_eXIf(png_ptr, info_ptr, length); diff --git a/contrib/libs/libpng/pngrio.c b/contrib/libs/libpng/pngrio.c index 7946358101..3b137f275f 100644 --- a/contrib/libs/libpng/pngrio.c +++ b/contrib/libs/libpng/pngrio.c @@ -1,4 +1,3 @@ - /* pngrio.c - functions for data input * * Copyright (c) 2018 Cosmin Truta diff --git a/contrib/libs/libpng/pngrtran.c b/contrib/libs/libpng/pngrtran.c index 1526123e02..124906635b 100644 --- a/contrib/libs/libpng/pngrtran.c +++ b/contrib/libs/libpng/pngrtran.c @@ -1,4 +1,3 @@ - /* pngrtran.c - transforms the data in a row for PNG readers * * Copyright (c) 2018-2024 Cosmin Truta diff --git a/contrib/libs/libpng/pngrutil.c b/contrib/libs/libpng/pngrutil.c index a4f5eb1eb6..c1cc4b2533 100644 --- a/contrib/libs/libpng/pngrutil.c +++ b/contrib/libs/libpng/pngrutil.c @@ -1,4 +1,3 @@ - /* pngrutil.c - utilities to read a PNG file * * Copyright (c) 2018-2024 Cosmin Truta @@ -18,6 +17,21 @@ #ifdef PNG_READ_SUPPORTED +#ifdef PNG_READ_INTERLACING_SUPPORTED +/* Arrays to facilitate interlacing - use pass (0 - 6) as index. */ + +/* Start of interlace block */ +static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; +/* Offset to next interlace block */ +static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; +/* Start of interlace block in the y direction */ +static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; +/* Offset to next interlace block in the y direction */ +static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + +/* TODO: Move these arrays to a common utility module to avoid duplication. */ +#endif + png_uint_32 PNGAPI png_get_uint_31(png_const_structrp png_ptr, png_const_bytep buf) { @@ -2037,6 +2051,47 @@ png_handle_bKGD(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) } #endif +#ifdef PNG_READ_cICP_SUPPORTED +void /* PRIVATE */ +png_handle_cICP(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) +{ + png_byte buf[4]; + + png_debug(1, "in png_handle_cICP"); + + if ((png_ptr->mode & PNG_HAVE_IHDR) == 0) + png_chunk_error(png_ptr, "missing IHDR"); + + else if ((png_ptr->mode & (PNG_HAVE_IDAT|PNG_HAVE_PLTE)) != 0) + { + png_crc_finish(png_ptr, length); + png_chunk_benign_error(png_ptr, "out of place"); + return; + } + + else if (info_ptr != NULL && (info_ptr->valid & PNG_INFO_cICP) != 0) + { + png_crc_finish(png_ptr, length); + png_chunk_benign_error(png_ptr, "duplicate"); + return; + } + + else if (length != 4) + { + png_crc_finish(png_ptr, length); + png_chunk_benign_error(png_ptr, "invalid"); + return; + } + + png_crc_read(png_ptr, buf, 4); + + if (png_crc_finish(png_ptr, 0) != 0) + return; + + png_set_cICP(png_ptr, info_ptr, buf[0], buf[1], buf[2], buf[3]); +} +#endif + #ifdef PNG_READ_eXIf_SUPPORTED void /* PRIVATE */ png_handle_eXIf(png_structrp png_ptr, png_inforp info_ptr, png_uint_32 length) @@ -3867,10 +3922,6 @@ void /* PRIVATE */ png_do_read_interlace(png_row_infop row_info, png_bytep row, int pass, png_uint_32 transformations /* Because these may affect the byte layout */) { - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - /* Offset to next interlace block */ - static const unsigned int png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - png_debug(1, "in png_do_read_interlace"); if (row != NULL && row_info != NULL) { @@ -4544,20 +4595,6 @@ png_read_finish_IDAT(png_structrp png_ptr) void /* PRIVATE */ png_read_finish_row(png_structrp png_ptr) { - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; - png_debug(1, "in png_read_finish_row"); png_ptr->row_number++; if (png_ptr->row_number < png_ptr->num_rows) @@ -4609,20 +4646,6 @@ png_read_finish_row(png_structrp png_ptr) void /* PRIVATE */ png_read_start_row(png_structrp png_ptr) { - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; - unsigned int max_pixel_depth; size_t row_bytes; diff --git a/contrib/libs/libpng/pngset.c b/contrib/libs/libpng/pngset.c index b29cd6181d..c4dfe7bbd2 100644 --- a/contrib/libs/libpng/pngset.c +++ b/contrib/libs/libpng/pngset.c @@ -1,7 +1,6 @@ - /* pngset.c - storage of image information into info struct * - * Copyright (c) 2018-2024 Cosmin Truta + * Copyright (c) 2018-2025 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. @@ -134,6 +133,32 @@ png_set_cHRM_XYZ(png_const_structrp png_ptr, png_inforp info_ptr, double red_X, #endif /* cHRM */ +#ifdef PNG_cICP_SUPPORTED +void PNGAPI +png_set_cICP(png_const_structrp png_ptr, png_inforp info_ptr, + png_byte colour_primaries, png_byte transfer_function, + png_byte matrix_coefficients, png_byte video_full_range_flag) +{ + png_debug1(1, "in %s storage function", "cICP"); + + if (png_ptr == NULL || info_ptr == NULL) + return; + + info_ptr->cicp_colour_primaries = colour_primaries; + info_ptr->cicp_transfer_function = transfer_function; + info_ptr->cicp_matrix_coefficients = matrix_coefficients; + info_ptr->cicp_video_full_range_flag = video_full_range_flag; + + if (info_ptr->cicp_matrix_coefficients != 0) + { + png_warning(png_ptr, "Invalid cICP matrix coefficients"); + return; + } + + info_ptr->valid |= PNG_INFO_cICP; +} +#endif /* cICP */ + #ifdef PNG_eXIf_SUPPORTED void PNGAPI png_set_eXIf(png_const_structrp png_ptr, png_inforp info_ptr, @@ -1540,6 +1565,7 @@ png_set_keep_unknown_chunks(png_structrp png_ptr, int keep, static const png_byte chunks_to_ignore[] = { 98, 75, 71, 68, '\0', /* bKGD */ 99, 72, 82, 77, '\0', /* cHRM */ + 99, 73, 67, 80, '\0', /* cICP */ 101, 88, 73, 102, '\0', /* eXIf */ 103, 65, 77, 65, '\0', /* gAMA */ 104, 73, 83, 84, '\0', /* hIST */ diff --git a/contrib/libs/libpng/pngstruct.h b/contrib/libs/libpng/pngstruct.h index 7a3069c895..40dee6d814 100644 --- a/contrib/libs/libpng/pngstruct.h +++ b/contrib/libs/libpng/pngstruct.h @@ -1,4 +1,3 @@ - /* pngstruct.h - header file for PNG reference library * * Copyright (c) 2018-2022 Cosmin Truta diff --git a/contrib/libs/libpng/pngtrans.c b/contrib/libs/libpng/pngtrans.c index 62cb21edf1..222b4987f9 100644 --- a/contrib/libs/libpng/pngtrans.c +++ b/contrib/libs/libpng/pngtrans.c @@ -1,4 +1,3 @@ - /* pngtrans.c - transforms the data in a row (used by both readers and writers) * * Copyright (c) 2018-2024 Cosmin Truta diff --git a/contrib/libs/libpng/pngwio.c b/contrib/libs/libpng/pngwio.c index 10e919dd03..38c9c006cb 100644 --- a/contrib/libs/libpng/pngwio.c +++ b/contrib/libs/libpng/pngwio.c @@ -1,4 +1,3 @@ - /* pngwio.c - functions for data output * * Copyright (c) 2018 Cosmin Truta diff --git a/contrib/libs/libpng/pngwrite.c b/contrib/libs/libpng/pngwrite.c index 9f3743bf58..a9788a3902 100644 --- a/contrib/libs/libpng/pngwrite.c +++ b/contrib/libs/libpng/pngwrite.c @@ -1,7 +1,6 @@ - /* pngwrite.c - general routines to write a PNG file * - * Copyright (c) 2018-2024 Cosmin Truta + * Copyright (c) 2018-2025 Cosmin Truta * Copyright (c) 1998-2002,2004,2006-2018 Glenn Randers-Pehrson * Copyright (c) 1996-1997 Andreas Dilger * Copyright (c) 1995-1996 Guy Eric Schalnat, Group 42, Inc. @@ -132,29 +131,61 @@ png_write_info_before_PLTE(png_structrp png_ptr, png_const_inforp info_ptr) if ((info_ptr->valid & PNG_INFO_acTL) != 0) png_write_acTL(png_ptr, info_ptr->num_frames, info_ptr->num_plays); #endif -#ifdef PNG_GAMMA_SUPPORTED -# ifdef PNG_WRITE_gAMA_SUPPORTED - if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && - (info_ptr->colorspace.flags & PNG_COLORSPACE_FROM_gAMA) != 0 && - (info_ptr->valid & PNG_INFO_gAMA) != 0) - png_write_gAMA_fixed(png_ptr, info_ptr->colorspace.gamma); -# endif +#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED + /* Write unknown chunks first; PNG v3 establishes a precedence order + * for colourspace chunks. It is certain therefore that new + * colourspace chunks will have a precedence and very likely it will be + * higher than all known so far. Writing the unknown chunks here is + * most likely to present the chunks in the most convenient order. + * + * FUTURE: maybe write chunks in the order the app calls png_set_chnk + * to give the app control. + */ + write_unknown_chunks(png_ptr, info_ptr, PNG_HAVE_IHDR); +#endif + +#ifdef PNG_WRITE_sBIT_SUPPORTED + /* PNG v3: a streaming app will need to see this before cICP because + * the information is helpful in handling HLG encoding (which is + * natively 10 bits but gets expanded to 16 in PNG.) + * + * The app shouldn't care about the order ideally, but it might have + * no choice. In PNG v3, apps are allowed to reject PNGs where the + * APNG chunks are out of order so it behooves libpng to be nice here. + */ + if ((info_ptr->valid & PNG_INFO_sBIT) != 0) + png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type); #endif + /* PNG v3: the July 2004 version of the TR introduced the concept of colour + * space priority. As above it therefore behooves libpng to write the colour + * space chunks in the priority order so that a streaming app need not buffer + * them. + */ #ifdef PNG_COLORSPACE_SUPPORTED - /* Write only one of sRGB or an ICC profile. If a profile was supplied - * and it matches one of the known sRGB ones issue a warning. +# ifdef PNG_WRITE_cICP_SUPPORTED /* Priority 4 */ + if ((info_ptr->valid & PNG_INFO_cICP) != 0) + { + png_write_cICP(png_ptr, + info_ptr->cicp_colour_primaries, + info_ptr->cicp_transfer_function, + info_ptr->cicp_matrix_coefficients, + info_ptr->cicp_video_full_range_flag); + } +# endif + + /* PNG v3 change: it is now permitted to write both sRGB and ICC profiles, + * however because the libpng code auto-generates an sRGB for the + * corresponding ICC profiles and because PNG v2 disallowed this we need + * to only write one. + * + * Remove the PNG v2 warning about writing an sRGB ICC profile as well + * because it's invalid with PNG v3. */ -# ifdef PNG_WRITE_iCCP_SUPPORTED +# ifdef PNG_WRITE_iCCP_SUPPORTED /* Priority 3 */ if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && (info_ptr->valid & PNG_INFO_iCCP) != 0) { -# ifdef PNG_WRITE_sRGB_SUPPORTED - if ((info_ptr->valid & PNG_INFO_sRGB) != 0) - png_app_warning(png_ptr, - "profile matches sRGB but writing iCCP instead"); -# endif - png_write_iCCP(png_ptr, info_ptr->iccp_name, info_ptr->iccp_profile); } @@ -163,20 +194,24 @@ png_write_info_before_PLTE(png_structrp png_ptr, png_const_inforp info_ptr) # endif # endif -# ifdef PNG_WRITE_sRGB_SUPPORTED +# ifdef PNG_WRITE_sRGB_SUPPORTED /* Priority 2 */ if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && (info_ptr->valid & PNG_INFO_sRGB) != 0) png_write_sRGB(png_ptr, info_ptr->colorspace.rendering_intent); # endif /* WRITE_sRGB */ #endif /* COLORSPACE */ -#ifdef PNG_WRITE_sBIT_SUPPORTED - if ((info_ptr->valid & PNG_INFO_sBIT) != 0) - png_write_sBIT(png_ptr, &(info_ptr->sig_bit), info_ptr->color_type); +#ifdef PNG_GAMMA_SUPPORTED +# ifdef PNG_WRITE_gAMA_SUPPORTED /* Priority 1 */ + if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && + (info_ptr->colorspace.flags & PNG_COLORSPACE_FROM_gAMA) != 0 && + (info_ptr->valid & PNG_INFO_gAMA) != 0) + png_write_gAMA_fixed(png_ptr, info_ptr->colorspace.gamma); +# endif #endif #ifdef PNG_COLORSPACE_SUPPORTED -# ifdef PNG_WRITE_cHRM_SUPPORTED +# ifdef PNG_WRITE_cHRM_SUPPORTED /* Also priority 1 */ if ((info_ptr->colorspace.flags & PNG_COLORSPACE_INVALID) == 0 && (info_ptr->colorspace.flags & PNG_COLORSPACE_FROM_cHRM) != 0 && (info_ptr->valid & PNG_INFO_cHRM) != 0) @@ -184,10 +219,6 @@ png_write_info_before_PLTE(png_structrp png_ptr, png_const_inforp info_ptr) # endif #endif -#ifdef PNG_WRITE_UNKNOWN_CHUNKS_SUPPORTED - write_unknown_chunks(png_ptr, info_ptr, PNG_HAVE_IHDR); -#endif - png_ptr->mode |= PNG_WROTE_INFO_BEFORE_PLTE; } } diff --git a/contrib/libs/libpng/pngwtran.c b/contrib/libs/libpng/pngwtran.c index 49a13c1e98..a20847023f 100644 --- a/contrib/libs/libpng/pngwtran.c +++ b/contrib/libs/libpng/pngwtran.c @@ -1,4 +1,3 @@ - /* pngwtran.c - transforms the data in a row for PNG writers * * Copyright (c) 2018 Cosmin Truta diff --git a/contrib/libs/libpng/pngwutil.c b/contrib/libs/libpng/pngwutil.c index bb731bc18b..e3db91bab4 100644 --- a/contrib/libs/libpng/pngwutil.c +++ b/contrib/libs/libpng/pngwutil.c @@ -1,4 +1,3 @@ - /* pngwutil.c - utilities to write a PNG file * * Copyright (c) 2018-2024 Cosmin Truta @@ -9,12 +8,30 @@ * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer * and license in png.h + * + * This file contains routines that are only called from within + * libpng itself during the course of writing an image. */ #include "pngpriv.h" #ifdef PNG_WRITE_SUPPORTED +#ifdef PNG_WRITE_INTERLACING_SUPPORTED +/* Arrays to facilitate interlacing - use pass (0 - 6) as index. */ + +/* Start of interlace block */ +static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; +/* Offset to next interlace block */ +static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; +/* Start of interlace block in the y direction */ +static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; +/* Offset to next interlace block in the y direction */ +static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; + +/* TODO: Move these arrays to a common utility module to avoid duplication. */ +#endif + #ifdef PNG_WRITE_INT_FUNCTIONS_SUPPORTED /* Place a 32-bit number into a buffer in PNG byte order. We work * with unsigned numbers for convenience, although one supported @@ -1496,6 +1513,29 @@ png_write_bKGD(png_structrp png_ptr, png_const_color_16p back, int color_type) } #endif +#ifdef PNG_WRITE_cICP_SUPPORTED +/* Write the cICP data */ +void /* PRIVATE */ +png_write_cICP(png_structrp png_ptr, + png_byte colour_primaries, png_byte transfer_function, + png_byte matrix_coefficients, png_byte video_full_range_flag) +{ + png_byte buf[4]; + + png_debug(1, "in png_write_cICP"); + + png_write_chunk_header(png_ptr, png_cICP, 4); + + buf[0] = colour_primaries; + buf[1] = transfer_function; + buf[2] = matrix_coefficients; + buf[3] = video_full_range_flag; + png_write_chunk_data(png_ptr, buf, 4); + + png_write_chunk_end(png_ptr); +} +#endif + #ifdef PNG_WRITE_eXIf_SUPPORTED /* Write the Exif data */ void /* PRIVATE */ @@ -1990,22 +2030,6 @@ png_write_fdAT(png_structp png_ptr, void /* PRIVATE */ png_write_start_row(png_structrp png_ptr) { -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; -#endif - png_alloc_size_t buf_size; int usr_pixel_depth; @@ -2105,22 +2129,6 @@ png_write_start_row(png_structrp png_ptr) void /* PRIVATE */ png_write_finish_row(png_structrp png_ptr) { -#ifdef PNG_WRITE_INTERLACING_SUPPORTED - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - - /* Start of interlace block in the y direction */ - static const png_byte png_pass_ystart[7] = {0, 0, 4, 0, 2, 0, 1}; - - /* Offset to next interlace block in the y direction */ - static const png_byte png_pass_yinc[7] = {8, 8, 8, 4, 4, 2, 2}; -#endif - png_debug(1, "in png_write_finish_row"); /* Next row */ @@ -2196,14 +2204,6 @@ png_write_finish_row(png_structrp png_ptr) void /* PRIVATE */ png_do_write_interlace(png_row_infop row_info, png_bytep row, int pass) { - /* Arrays to facilitate easy interlacing - use pass (0 - 6) as index */ - - /* Start of interlace block */ - static const png_byte png_pass_start[7] = {0, 4, 0, 2, 0, 1, 0}; - - /* Offset to next interlace block */ - static const png_byte png_pass_inc[7] = {8, 8, 4, 4, 2, 2, 1}; - png_debug(1, "in png_do_write_interlace"); /* We don't have to do anything on the last pass (6) */ diff --git a/contrib/libs/libpng/powerpc/powerpc_init.c b/contrib/libs/libpng/powerpc/powerpc_init.c index e208ad4390..b533cc5527 100644 --- a/contrib/libs/libpng/powerpc/powerpc_init.c +++ b/contrib/libs/libpng/powerpc/powerpc_init.c @@ -1,4 +1,3 @@ - /* powerpc_init.c - POWERPC optimised filter functions * * Copyright (c) 2018 Cosmin Truta diff --git a/contrib/libs/libpng/ya.make b/contrib/libs/libpng/ya.make index 586bbe1c9e..25b40692aa 100644 --- a/contrib/libs/libpng/ya.make +++ b/contrib/libs/libpng/ya.make @@ -10,9 +10,9 @@ LICENSE( LICENSE_TEXTS(.yandex_meta/licenses.list.txt) -VERSION(1.6.44) +VERSION(1.6.45) -ORIGINAL_SOURCE(https://github.com/pnggroup/libpng/archive/v1.6.44.tar.gz) +ORIGINAL_SOURCE(https://github.com/pnggroup/libpng/archive/v1.6.45.tar.gz) PEERDIR( contrib/libs/zlib |