diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index 25b51151d..e97d31ec6 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -1196,7 +1196,10 @@ SDL_Surface *X11_SetVideoMode(_THIS, SDL_Surface *current, current->w = width; current->h = height; current->pitch = SDL_CalculatePitch(current); - X11_ResizeImage(this, current, flags); + if (X11_ResizeImage(this, current, flags) < 0) { + current = NULL; + goto done; + } } /* Clear these flags and set them only if they are in the new set. */