26 lines
889 B
Diff
26 lines
889 B
Diff
From 26af56ed7ffbec97640c52145137a5f41ec8213b Mon Sep 17 00:00:00 2001
|
|
From: Joshua Sager <joshua.sager@shopify.com>
|
|
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
|
|
|