Skip to content

Commit

Permalink
Fixed crash in shape test program if memory allocation failed.
Browse files Browse the repository at this point in the history
  • Loading branch information
philippwiesemann committed May 10, 2016
1 parent 31e23d5 commit 73b63e5
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/testshape.c
Expand Up @@ -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<num_pictures;i++)
pictures[i].surface = NULL;
for(i=0;i<num_pictures;i++) {
Expand Down

0 comments on commit 73b63e5

Please sign in to comment.