From 00394996eb7e48e2f23a7aff15418813951044f0 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Fri, 2 Jun 2017 22:15:12 +0200 Subject: [PATCH] Fixed crash if calling SDL_CreateShapedWindow() on unsupported platforms. --- src/video/SDL_shape.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/video/SDL_shape.c b/src/video/SDL_shape.c index 799266bdf..451f2aca3 100644 --- a/src/video/SDL_shape.c +++ b/src/video/SDL_shape.c @@ -35,6 +35,10 @@ SDL_CreateShapedWindow(const char *title,unsigned int x,unsigned int y,unsigned SDL_Window *result = NULL; result = SDL_CreateWindow(title,-1000,-1000,w,h,(flags | SDL_WINDOW_BORDERLESS) & (~SDL_WINDOW_FULLSCREEN) & (~SDL_WINDOW_RESIZABLE) /* & (~SDL_WINDOW_SHOWN) */); if(result != NULL) { + if (SDL_GetVideoDevice()->shape_driver.CreateShaper == NULL) { + SDL_DestroyWindow(result); + return NULL; + } result->shaper = SDL_GetVideoDevice()->shape_driver.CreateShaper(result); if(result->shaper != NULL) { result->shaper->userx = x;