From 509e05acd85262a67c6632b0ed7d7e7c40a6acca Mon Sep 17 00:00:00 2001
From: Sylvain Becker <[EMAIL REDACTED]>
Date: Thu, 24 Nov 2022 16:29:41 +0100
Subject: [PATCH] IMG_ImageIO: prefer SDL_stack_alloc
---
IMG_ImageIO.m | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/IMG_ImageIO.m b/IMG_ImageIO.m
index 65089512..314564a2 100644
--- a/IMG_ImageIO.m
+++ b/IMG_ImageIO.m
@@ -290,7 +290,7 @@ static CFDictionaryRef CreateHintDictionary(CFStringRef uti_string_hint)
size_t num_entries = CGColorSpaceGetColorTableCount(color_space);
uint8_t *entry, *entries;
- entries = SDL_calloc(num_components * num_entries, sizeof(uint8_t));
+ entries = SDL_stack_alloc(uint8_t, num_components * num_entries);
if (entries == NULL) {
SDL_OutOfMemory();
@@ -332,7 +332,7 @@ static CFDictionaryRef CreateHintDictionary(CFStringRef uti_string_hint)
}
}
- SDL_free(entries);
+ SDL_stack_free(entries);
return surface;
}