From f212cb5f927415e091d907c7f7e7308bd25f58d3 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Mon, 14 Oct 2024 20:54:17 -0500 Subject: [PATCH] Don't overwrite the SDL_IOFromConstMem() error in testshape --- test/testshape.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/test/testshape.c b/test/testshape.c index b42c7e8ae..c4f0988b3 100644 --- a/test/testshape.c +++ b/test/testshape.c @@ -60,7 +60,12 @@ int main(int argc, char *argv[]) goto quit; } } else { - shape = SDL_LoadBMP_IO(SDL_IOFromConstMem(glass_bmp, sizeof(glass_bmp)), true); + SDL_IOStream *stream = SDL_IOFromConstMem(glass_bmp, sizeof(glass_bmp)); + if (!stream) { + SDL_Log("Couldn't create iostream for glass.bmp: %s\n", SDL_GetError()); + goto quit; + } + shape = SDL_LoadBMP_IO(stream, true); if (!shape) { SDL_Log("Couldn't load glass.bmp: %s\n", SDL_GetError()); goto quit;