From cbd7803e61e9a21e0a8d0b01a4d47dcb8f4cb288 Mon Sep 17 00:00:00 2001 From: toaster Date: Sun, 18 May 2025 15:39:00 +0100 Subject: [PATCH] apng_create_info_struct: Swap order of calloc params Instead of making one apng_info sized struct, it was making apng_info's size many bytes. Which SHOULD be identical, but in the case of padding may not be. Certainly enough of a risk for the compiler to warn about it --- src/apng.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/apng.c b/src/apng.c index a5f2485d7..6216fb347 100644 --- a/src/apng.c +++ b/src/apng.c @@ -71,7 +71,7 @@ apng_create_info_struct (png_structp pngp) { apng_infop ainfop; (void)pngp; - if (( ainfop = calloc(sizeof (apng_info),1) )) + if (( ainfop = calloc(1, sizeof (apng_info)) )) { apng_set_write_fn(pngp, ainfop, 0, 0, 0, 0, 0); apng_set_set_acTL_fn(pngp, ainfop, 0);