| Summary: | Cocoa : ScheduleContextUpdates does not check given parameter ONLY with SDL_WINDOW_FULLSCREEN_DESKTOP flags | ||
|---|---|---|---|
| Product: | SDL | Reporter: | jeroen.clarysse |
| Component: | video | Assignee: | Ryan C. Gordon <icculus> |
| Status: | RESOLVED DUPLICATE | QA Contact: | Sam Lantinga <slouken> |
| Severity: | major | ||
| Priority: | P2 | CC: | sezeroz |
| Version: | 2.0.9 | ||
| Hardware: | x86 | ||
| OS: | macOS 10.13 | ||
| Attachments: | ScheduleContextUpdates crashes for SDL_WINDOW_FULLSCREEN_DESKTOP windows | ||
Ryan, the fix is pretty straightforward, but can you look and see what's happening here? |
Created attachment 3495 [details] ScheduleContextUpdates crashes for SDL_WINDOW_FULLSCREEN_DESKTOP windows the function ScheduleContextUpdates(SDL_WindowData *data) in the file SDL_cocoawindow.m does NOT check if data is valid. My application crashes upon exiting with a EXC_BAD_ACCESS exception this is on OSX 10.14 (which is not selectable in bugzilla...) in attach is a simple application that just does this : SDL_Renderer* renderer; SDL_Init( SDL_INIT_EVERYTHING ); // TTF_Init(); SDL_Window *window; // Declare a pointer to an SDL_Window int dialog_w = 640; int dialog_h = 480; window = SDL_CreateWindow("Keystroke detection",SDL_WINDOWPOS_UNDEFINED,SDL_WINDOWPOS_UNDEFINED,dialog_w,dialog_h,SDL_WINDOW_FULLSCREEN_DESKTOP|SDL_WINDOW_SHOWN|SDL_WINDOW_BORDERLESS); renderer = SDL_CreateRenderer(window, -1, 0); SDL_Delay(2500); SDL_DestroyRenderer(renderer); SDL_Delay(2500); SDL_DestroyWindow(window); SDL_Delay(2500); SDL_Quit(); note : this ONLY happens if the window was created with SDL_WINDOW_FULLSCREEN_DESKTOP flags !!! fix is simple : add these lines as first 2 lines in ScheduleContextUpdates implementation if (!data || data->window == NULL || data->nswindow == nil) return;