Merge tag 'v1.6.53' into branch 'libpng18' into develop
diff --git a/AUTHORS.md b/AUTHORS.md index a205024..ac60ee9 100644 --- a/AUTHORS.md +++ b/AUTHORS.md
@@ -5,6 +5,7 @@ Authors, for copyright and licensing purposes. * Adam Richter + * Alexander Smorkalov * Andreas Dilger * Chris Blume * Cosmin Truta @@ -59,7 +60,7 @@ * Samsung Group - Filip Wasil * SpacemiT Hangzhou Technology, Co. - - Liang Junzhao + - Liang Junzhao (梁俊钊) The build projects, the build scripts, the test scripts, and other files in the "projects", "scripts" and "tests" directories, have
diff --git a/CHANGES b/CHANGES index 527dc76..f89e105 100644 --- a/CHANGES +++ b/CHANGES
@@ -6315,6 +6315,12 @@ Added allocation failure fuzzing to oss-fuzz. (Contributed by Philippe Antoine.) +Version 1.6.53 [December 5, 2025] + Fixed a build failure on RISC-V RVV caused by a misspelled intrinsic. + (Contributed by Alexander Smorkalov.) + Fixed a build failure with CMake 4.1 or newer, on Windows, when using + Visual C++ without MASM installed. + Version 2.0.0 [TODO] Send comments/corrections/commendations to png-mng-implement at lists.sf.net.
diff --git a/CMakeLists.txt b/CMakeLists.txt index 7b3e52e..a8b4a23 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt
@@ -27,7 +27,7 @@ project(libpng VERSION ${PNGLIB_VERSION} - LANGUAGES C ASM) + LANGUAGES C) include(CheckCSourceCompiles) include(CheckLibraryExists)
diff --git a/manuals/libpng-manual.txt b/manuals/libpng-manual.txt index 1946f8c..3ae2bfe 100644 --- a/manuals/libpng-manual.txt +++ b/manuals/libpng-manual.txt
@@ -9,7 +9,7 @@ Based on: - libpng version 1.6.36, December 2018, through 1.6.52 - December 2025 + libpng version 1.6.36, December 2018, through 1.6.53 - December 2025 Updated and distributed by Cosmin Truta Copyright (c) 2018-2025 Cosmin Truta
diff --git a/manuals/libpng.3 b/manuals/libpng.3 index c406dcc..2fa8bdb 100644 --- a/manuals/libpng.3 +++ b/manuals/libpng.3
@@ -1,4 +1,4 @@ -.TH LIBPNG 3 "December 3, 2025" +.TH LIBPNG 3 "December 5, 2025" .SH NAME libpng \- Portable Network Graphics (PNG) Reference Library 1.8.0.git @@ -516,7 +516,7 @@ Based on: - libpng version 1.6.36, December 2018, through 1.6.52 - December 2025 + libpng version 1.6.36, December 2018, through 1.6.53 - December 2025 Updated and distributed by Cosmin Truta Copyright (c) 2018-2025 Cosmin Truta
diff --git a/manuals/png.5 b/manuals/png.5 index fbb88ab..ba1a4d5 100644 --- a/manuals/png.5 +++ b/manuals/png.5
@@ -1,4 +1,4 @@ -.TH PNG 5 "December 3, 2025" +.TH PNG 5 "December 5, 2025" .SH NAME png \- Portable Network Graphics (PNG) format
diff --git a/png.h b/png.h index 35be19c..ccd3a6b 100644 --- a/png.h +++ b/png.h
@@ -14,7 +14,7 @@ * libpng versions 0.89, June 1996, through 0.96, May 1997: Andreas Dilger * libpng versions 0.97, January 1998, through 1.6.35, July 2018: * Glenn Randers-Pehrson - * libpng versions 1.6.36, December 2018, through 1.6.52, December 2025: + * libpng versions 1.6.36, December 2018, through 1.6.53, December 2025: * Cosmin Truta * See also "Contributing Authors", below. */
diff --git a/pngread.c b/pngread.c index eb2cccc..8b4218b 100644 --- a/pngread.c +++ b/pngread.c
@@ -3366,7 +3366,7 @@ /* Clamp to the valid range to defend against * unforeseen cases where the data might be sRGB * instead of linear premultiplied. - * (Belt-and-suspenders for GitHub Issue #764.) + * (Belt-and-suspenders for CVE-2025-66293.) */ if (component > 255*65535) component = 255*65535;
diff --git a/riscv/filter_rvv_intrinsics.c b/riscv/filter_rvv_intrinsics.c index d91f80f..7076276 100644 --- a/riscv/filter_rvv_intrinsics.c +++ b/riscv/filter_rvv_intrinsics.c
@@ -2,9 +2,11 @@ * * Copyright (c) 2023 Google LLC * Written by Manfred SCHLAEGL, 2022 - * Dragoș Tiselice <dtiselice@google.com>, May 2023. - * Filip Wasil <f.wasil@samsung.com>, March 2025. - * Liang Junzhao <junzhao.liang@spacemit.com>, November 2025. + * Revised by: + * - Dragoș Tiselice <dtiselice@google.com>, May 2023 + * - Filip Wasil <f.wasil@samsung.com>, March 2025 + * - Liang Junzhao <junzhao.liang@spacemit.com>, November 2025 + * - Alexander Smorkalov <alexander.smorkalov@opencv.ai>, December 2025 * * This code is released under the libpng license. * For conditions of distribution and use, see the disclaimer @@ -142,7 +144,7 @@ x = __riscv_vle8_v_u8m1(row, vl); /* a = (a + b) / 2, round to zero with vxrm = 2 */ - a = __riscv_vaaddu_wx_u8m1(a, b, 2, vl); + a = __riscv_vaaddu_vv_u8m1(a, b, 2, vl); /* a += x */ a = __riscv_vadd_vv_u8m1(a, x, vl); @@ -175,47 +177,6 @@ PNG_UNUSED(prev_row) } -#define MIN_CHUNK_LEN 256 -#define MAX_CHUNK_LEN 2048 - -static inline vuint8m1_t -prefix_sum(vuint8m1_t chunk, unsigned char *carry, size_t vl, - size_t max_chunk_len) -{ - size_t r; - - for (r = 1; r < MIN_CHUNK_LEN; r <<= 1) - { - vbool8_t shift_mask = __riscv_vmsgeu_vx_u8m1_b8(__riscv_vid_v_u8m1(vl), r, vl); - chunk = __riscv_vadd_vv_u8m1_mu(shift_mask, chunk, chunk, __riscv_vslideup_vx_u8m1(__riscv_vundefined_u8m1(), chunk, r, vl), vl); - } - - for (r = MIN_CHUNK_LEN; r < MAX_CHUNK_LEN && r < max_chunk_len; r <<= 1) - { - vbool8_t shift_mask = __riscv_vmsgeu_vx_u8m1_b8(__riscv_vid_v_u8m1(vl), r, vl); - chunk = __riscv_vadd_vv_u8m1_mu(shift_mask, chunk, chunk, __riscv_vslideup_vx_u8m1(__riscv_vundefined_u8m1(), chunk, r, vl), vl); - } - - chunk = __riscv_vadd_vx_u8m1(chunk, *carry, vl); - *carry = __riscv_vmv_x_s_u8m1_u8(__riscv_vslidedown_vx_u8m1(chunk, vl - 1, vl)); - - return chunk; -} - -static inline vint16m1_t -abs_diff(vuint16m1_t a, vuint16m1_t b, size_t vl) -{ - vint16m1_t diff = __riscv_vreinterpret_v_u16m1_i16m1(__riscv_vsub_vv_u16m1(a, b, vl)); - vbool16_t mask = __riscv_vmslt_vx_i16m1_b16(diff, 0, vl); - return __riscv_vrsub_vx_i16m1_m(mask, diff, 0, vl); -} - -static inline vint16m1_t -abs_sum(vint16m1_t a, vint16m1_t b, size_t vl) -{ - return __riscv_vadd_vv_i16m1(a, b, vl); -} - static inline void png_read_filter_row_paeth_rvv(size_t len, size_t bpp, unsigned char *row, const unsigned char *prev)
diff --git a/scripts/cmake/AUTHORS.md b/scripts/cmake/AUTHORS.md index c25a505..2731095 100644 --- a/scripts/cmake/AUTHORS.md +++ b/scripts/cmake/AUTHORS.md
@@ -31,6 +31,7 @@ * Jon Creighton * Joost Nieuwenhuijse * Kyle Bentley + * Luis Caro Campos * Martin Storsjö * Owen Rudge * Philip Lowman