Fixed crash if calling SDL_CreateShapedWindow() on unsupported platforms.
authorPhilipp Wiesemann <philipp.wiesemann@arcor.de>
Fri, 02 Jun 2017 22:15:12 +0200
changeset 110572442e955634b
parent 11055 1f2cb42aa5d3
child 11058 62185069194d
Fixed crash if calling SDL_CreateShapedWindow() on unsupported platforms.
src/video/SDL_shape.c
     1.1 --- a/src/video/SDL_shape.c	Sat Apr 22 19:53:52 2017 +0200
     1.2 +++ b/src/video/SDL_shape.c	Fri Jun 02 22:15:12 2017 +0200
     1.3 @@ -35,6 +35,10 @@
     1.4      SDL_Window *result = NULL;
     1.5      result = SDL_CreateWindow(title,-1000,-1000,w,h,(flags | SDL_WINDOW_BORDERLESS) & (~SDL_WINDOW_FULLSCREEN) & (~SDL_WINDOW_RESIZABLE) /* & (~SDL_WINDOW_SHOWN) */);
     1.6      if(result != NULL) {
     1.7 +        if (SDL_GetVideoDevice()->shape_driver.CreateShaper == NULL) {
     1.8 +            SDL_DestroyWindow(result);
     1.9 +            return NULL;
    1.10 +        }
    1.11          result->shaper = SDL_GetVideoDevice()->shape_driver.CreateShaper(result);
    1.12          if(result->shaper != NULL) {
    1.13              result->shaper->userx = x;