From 73b63e5b57c7f7fa50b4ca7a09f48e12298e9d91 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Tue, 10 May 2016 21:13:58 +0200 Subject: [PATCH] Fixed crash in shape test program if memory allocation failed. --- test/testshape.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/test/testshape.c b/test/testshape.c index 00750a97088c4..476fac21ec386 100644 --- a/test/testshape.c +++ b/test/testshape.c @@ -71,6 +71,10 @@ int main(int argc,char** argv) num_pictures = argc - 1; pictures = (LoadedPicture *)SDL_malloc(sizeof(LoadedPicture)*num_pictures); + if (!pictures) { + SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Could not allocate memory."); + exit(1); + } for(i=0;i