Skip to content

Commit

Permalink
directfb: Fixed crash if creating renderer.
Browse files Browse the repository at this point in the history
SDL_GetWindowWMInfo() currently expects SDL to be 2.0.6 but SDL is still 2.0.5.
  • Loading branch information
philippwiesemann committed Jun 11, 2017
1 parent 121d7d2 commit c609d85
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/video/directfb/SDL_DirectFB_render.c
Expand Up @@ -217,7 +217,9 @@ static SDL_INLINE IDirectFBSurface *get_dfb_surface(SDL_Window *window)
SDL_memset(&wm_info, 0, sizeof(SDL_SysWMinfo));

SDL_VERSION(&wm_info.version);
SDL_GetWindowWMInfo(window, &wm_info);
if (!SDL_GetWindowWMInfo(window, &wm_info)) {
return NULL;
}

return wm_info.info.dfb.surface;
}
Expand All @@ -228,7 +230,9 @@ static SDL_INLINE IDirectFBWindow *get_dfb_window(SDL_Window *window)
SDL_memset(&wm_info, 0, sizeof(SDL_SysWMinfo));

SDL_VERSION(&wm_info.version);
SDL_GetWindowWMInfo(window, &wm_info);
if (!SDL_GetWindowWMInfo(window, &wm_info)) {
return NULL;
}

return wm_info.info.dfb.window;
}
Expand Down Expand Up @@ -356,6 +360,10 @@ DirectFB_CreateRenderer(SDL_Window * window, Uint32 flags)
DirectFB_RenderData *data = NULL;
DFBSurfaceCapabilities scaps;

if (!winsurf) {
return NULL;
}

SDL_DFB_ALLOC_CLEAR(renderer, sizeof(*renderer));
SDL_DFB_ALLOC_CLEAR(data, sizeof(*data));

Expand Down

0 comments on commit c609d85

Please sign in to comment.