From 7501f7194be92fc7550acf1d43fe9f584a10bc2e Mon Sep 17 00:00:00 2001 From: Anonymous Maarten Date: Fri, 19 Sep 2025 15:37:21 +0200 Subject: [PATCH] testsprite: zero initialize textures LoadSprite destroys current textures before allocating new ones. So make sure the previous (=first) textures are valid. --- test/testsprite.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testsprite.c b/test/testsprite.c index dd146a9bc4..1006d13166 100644 --- a/test/testsprite.c +++ b/test/testsprite.c @@ -502,7 +502,7 @@ SDL_AppResult SDL_AppInit(void **appstate, int argc, char *argv[]) /* Create the windows, initialize the renderers, and load the textures */ sprites = - (SDL_Texture **)SDL_malloc(state->num_windows * sizeof(*sprites)); + (SDL_Texture **)SDL_calloc(state->num_windows, sizeof(*sprites)); if (!sprites) { SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Out of memory!"); return SDL_APP_FAILURE;