From bb1304f6a295310514e9d3ef8f7018f2b6b55304 Mon Sep 17 00:00:00 2001 From: zhangxingrong Date: Fri, 12 Jul 2024 15:37:03 +0800 Subject: [PATCH] add upstream patch --- ...tion-result-converted-to-larger-type.patch | 22 +++++++++++++++++++ zopfli.spec | 8 ++++++- 2 files changed, 29 insertions(+), 1 deletion(-) create mode 100644 backport-Multiplication-result-converted-to-larger-type.patch diff --git a/backport-Multiplication-result-converted-to-larger-type.patch b/backport-Multiplication-result-converted-to-larger-type.patch new file mode 100644 index 0000000..334dba8 --- /dev/null +++ b/backport-Multiplication-result-converted-to-larger-type.patch @@ -0,0 +1,22 @@ +From 55bdd963ee5c209374140219c275497fddd84bd5 Mon Sep 17 00:00:00 2001 +From: Shivam7-1 <55046031+Shivam7-1@users.noreply.github.com> +Date: Wed, 28 Feb 2024 18:29:24 +0530 +Subject: [PATCH] Update lodepng_util.cpp + +--- + src/zopflipng/lodepng/lodepng_util.cpp | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/zopflipng/lodepng/lodepng_util.cpp b/src/zopflipng/lodepng/lodepng_util.cpp +index 574138a1..11a6c0f3 100644 +--- a/src/zopflipng/lodepng/lodepng_util.cpp ++++ b/src/zopflipng/lodepng/lodepng_util.cpp +@@ -1151,7 +1151,7 @@ unsigned convertToXYZ(float* out, float whitepoint[3], const unsigned char* in, + use_icc = validateICC(&icc); + } + +- data = (unsigned char*)lodepng_malloc(w * h * (bit16 ? 8 : 4)); ++ data = (unsigned char*)lodepng_malloc((size_t)w * (size_t)h * (bit16 ? 8 : 4)); + error = lodepng_convert(data, in, &tempmode, mode_in, w, h); + if(error) goto cleanup; + diff --git a/zopfli.spec b/zopfli.spec index 27d8bb3..8ead7a8 100644 --- a/zopfli.spec +++ b/zopfli.spec @@ -1,10 +1,13 @@ Name: zopfli Version: 1.0.3 -Release: 2 +Release: 3 Summary: Compression library programmed in C License: ASL 2.0 URL: https://github.com/google/zopfli Source0: https://github.com/google/zopfli/archive/zopfli-%{version}.tar.gz + +Patch1: backport-Multiplication-result-converted-to-larger-type.patch + BuildRequires: gcc-c++ @@ -30,6 +33,9 @@ chmod 0755 %{buildroot}%{_bindir}/zopfli* %changelog +* Fri Jul 12 2024 zhangxingrong- -1.0.3-3 +- Multiplication result converted to larger type + * Thu Oct 27 2022 licihua -1.0.3-2 - Delete unused files -- Gitee