Skip to content

Commit

Permalink
Mir: Fixed crash if creating default cursor failed.
Browse files Browse the repository at this point in the history
Found by Cppcheck.
  • Loading branch information
philippwiesemann committed Mar 4, 2017
1 parent 42d0289 commit 72fdf62
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/video/mir/SDL_mirmouse.c
Expand Up @@ -140,12 +140,14 @@ MIR_CreateSystemCursor(SDL_SystemCursor id)
{
char const* cursor_name = NULL;
SDL_Cursor* cursor = MIR_CreateDefaultCursor();
MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata;
MIR_Cursor* mir_cursor;

if (!cursor) {
return NULL;
}

mir_cursor = (MIR_Cursor*)cursor->driverdata;

switch(id) {
case SDL_SYSTEM_CURSOR_ARROW:
cursor_name = MIR_mir_arrow_cursor_name;
Expand Down

0 comments on commit 72fdf62

Please sign in to comment.