From 9ac0f66add94094fd3ebc069659a96c2f57c2dd9 Mon Sep 17 00:00:00 2001 From: zhwang0 Date: Fri, 5 Sep 2025 14:50:00 +0800 Subject: [PATCH] update patch for libpng Signed-off-by: zhwang0 --- backport-libpng-1.6.37-enable-valid.patch | 3 ++- install.py | 2 -- libpng_optimize.patch | 12 ++++++------ 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/backport-libpng-1.6.37-enable-valid.patch b/backport-libpng-1.6.37-enable-valid.patch index 2857d0731..84daa02ef 100644 --- a/backport-libpng-1.6.37-enable-valid.patch +++ b/backport-libpng-1.6.37-enable-valid.patch @@ -202,4 +202,5 @@ index 8ef8bbd..fd74a39 100644 + if (size != 0 && items >= (~(png_alloc_size_t)0)/size) { png_warning (png_voidcast(png_structrp, png_ptr), - "Potential overflow in png_zalloc()"); \ No newline at end of file + "Potential overflow in png_zalloc()"); + diff --git a/install.py b/install.py index c4e859b32..fca4d5b12 100755 --- a/install.py +++ b/install.py @@ -32,7 +32,6 @@ def untar_file(tar_file_path, extract_path): def move_file(src_path, dst_path): files = [ - "CVE-2019-6129.patch", "huawei_libpng_CMakeList.patch", "libpng-fix-arm-neon.patch", "libpng-multilib.patch", @@ -60,7 +59,6 @@ def apply_patch(patch_file, target_dir): def do_patch(target_dir): patch_file = [ - "CVE-2019-6129.patch", "huawei_libpng_CMakeList.patch", "libpng-fix-arm-neon.patch", "libpng-multilib.patch", diff --git a/libpng_optimize.patch b/libpng_optimize.patch index 4892eadd4..350fbb457 100644 --- a/libpng_optimize.patch +++ b/libpng_optimize.patch @@ -1613,7 +1613,7 @@ diff --git a/pngpriv.h b/pngpriv.h index fb521cf00..6027d9acc 100644 --- a/pngpriv.h +++ b/pngpriv.h -@@ -189,6 +189,20 @@ +@@ -148,6 +148,20 @@ # define PNG_ARM_NEON_IMPLEMENTATION 0 #endif /* PNG_ARM_NEON_OPT > 0 */ @@ -1632,9 +1632,9 @@ index fb521cf00..6027d9acc 100644 +#endif + #ifndef PNG_MIPS_MSA_OPT - # if defined(__mips_msa) && (__mips_isa_rev >= 5) && defined(PNG_ALIGNED_MEMORY_SUPPORTED) - # define PNG_MIPS_MSA_OPT 2 -@@ -351,8 +365,14 @@ + # if defined(__mips_msa) && (__mips_isa_rev >= 5) && \ + defined(PNG_ALIGNED_MEMORY_SUPPORTED) +@@ -354,8 +368,14 @@ #endif #ifndef PNG_INTERNAL_FUNCTION @@ -1650,7 +1650,7 @@ index fb521cf00..6027d9acc 100644 #endif #ifndef PNG_INTERNAL_CALLBACK -@@ -1304,6 +1324,50 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop +@@ -1297,6 +1317,50 @@ PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth3_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); PNG_INTERNAL_FUNCTION(void,png_read_filter_row_paeth4_neon,(png_row_infop row_info, png_bytep row, png_const_bytep prev_row),PNG_EMPTY); @@ -1700,7 +1700,7 @@ index fb521cf00..6027d9acc 100644 +#endif #endif - #if PNG_MIPS_MSA_OPT > 0 + #if PNG_MIPS_MSA_IMPLEMENTATION == 1 diff --git a/pngread.c b/pngread.c index 8fa7d9f16..71be1a26c 100644 --- a/pngread.c