mirror of
https://github.com/Relintai/sdl2_frt.git
synced 2024-12-25 09:17:12 +01:00
Mir: Fixed crash if creating default cursor failed.
Found by Cppcheck.
This commit is contained in:
parent
42d02890f4
commit
72fdf62980
@ -140,12 +140,14 @@ MIR_CreateSystemCursor(SDL_SystemCursor id)
|
|||||||
{
|
{
|
||||||
char const* cursor_name = NULL;
|
char const* cursor_name = NULL;
|
||||||
SDL_Cursor* cursor = MIR_CreateDefaultCursor();
|
SDL_Cursor* cursor = MIR_CreateDefaultCursor();
|
||||||
MIR_Cursor* mir_cursor = (MIR_Cursor*)cursor->driverdata;
|
MIR_Cursor* mir_cursor;
|
||||||
|
|
||||||
if (!cursor) {
|
if (!cursor) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
mir_cursor = (MIR_Cursor*)cursor->driverdata;
|
||||||
|
|
||||||
switch(id) {
|
switch(id) {
|
||||||
case SDL_SYSTEM_CURSOR_ARROW:
|
case SDL_SYSTEM_CURSOR_ARROW:
|
||||||
cursor_name = MIR_mir_arrow_cursor_name;
|
cursor_name = MIR_mir_arrow_cursor_name;
|
||||||
|
Loading…
Reference in New Issue
Block a user