mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-05-28 20:09:38 +08:00
Fixed crash if display couldn't be found in SDL_UpdateFullscreenMode()
This commit is contained in:
@@ -1462,6 +1462,10 @@ static int SDL_UpdateFullscreenMode(SDL_Window *window, SDL_bool fullscreen)
|
|||||||
/* Get the correct display for this operation */
|
/* Get the correct display for this operation */
|
||||||
if (fullscreen) {
|
if (fullscreen) {
|
||||||
display = SDL_GetVideoDisplayForWindow(window);
|
display = SDL_GetVideoDisplayForWindow(window);
|
||||||
|
if (!display) {
|
||||||
|
/* This should never happen, but it did... */
|
||||||
|
goto done;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < _this->num_displays; ++i) {
|
for (i = 0; i < _this->num_displays; ++i) {
|
||||||
display = &_this->displays[i];
|
display = &_this->displays[i];
|
||||||
|
|||||||
Reference in New Issue
Block a user