diff --git a/0001-Initialize-rows-using-heap-for-large-images.patch b/0001-Initialize-rows-using-heap-for-large-images.patch new file mode 100644 index 0000000000000000000000000000000000000000..3f0222aded1c166bb212afa85649b57c626cdc59 --- /dev/null +++ b/0001-Initialize-rows-using-heap-for-large-images.patch @@ -0,0 +1,25 @@ +From 26af56ed7ffbec97640c52145137a5f41ec8213b Mon Sep 17 00:00:00 2001 +From: Joshua Sager +Date: Mon, 13 Sep 2021 17:50:33 -0400 +Subject: [PATCH] Initialize rows using heap for large images + +--- + libimagequant.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/libimagequant.c b/libimagequant.c +index 5507614..18b5ef6 100644 +--- a/libimagequant.c ++++ b/libimagequant.c +@@ -2100,7 +2100,7 @@ LIQ_EXPORT LIQ_NONNULL liq_error liq_write_remapped_image(liq_result *result, li + return LIQ_BUFFER_TOO_SMALL; + } + +- LIQ_ARRAY(unsigned char *, rows, input_image->height); ++ unsigned char **rows = malloc(input_image->height * sizeof(unsigned char *)); + unsigned char *buffer_bytes = buffer; + for(unsigned int i=0; i < input_image->height; i++) { + rows[i] = &buffer_bytes[input_image->width * i]; +-- +2.42.0.windows.2 + diff --git a/libimagequant.spec b/libimagequant.spec index 0c17b1a906a01e575b21288fae71feb0e8e02e5d..6cb362cd2deff30de882119bbf9b46eaa28ac357 100644 --- a/libimagequant.spec +++ b/libimagequant.spec @@ -1,6 +1,6 @@ Name: libimagequant Version: 2.15.1 -Release: 3 +Release: 4 Summary: Palette quantization library License: GPLv3+ and MIT URL: https://github.com/ImageOptim/libimagequant @@ -8,7 +8,7 @@ Source0: %{url}/archive/%{version}/%{name}-%{version}.tar.gz Patch0000: libimagequant_solibperm.patch Patch0001: 0001-de-recurse-hist_item_sort_halfvar.patch - +Patch0002: 0001-Initialize-rows-using-heap-for-large-images.patch BuildRequires: gcc @@ -49,6 +49,9 @@ rm -f %{buildroot}%{_libdir}/%{name}.a %{_libdir}/pkgconfig/imagequant.pc %changelog +* Thu Nov 22 2023 liubo - 2.15.1-4 +- Initialize rows using heap for large images + * Mon Oct 23 2023 liubo - 2.15.1-3 - de-recurse hist_item_sort_halfvar()