Skip to content

Commit

Permalink
Improved bug #759
Browse files Browse the repository at this point in the history
Don't crash if creating the X image failed.
  • Loading branch information
slouken committed Sep 27, 2009
1 parent 933602e commit 7ec6170
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/video/x11/SDL_x11video.c
Expand Up @@ -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. */
Expand Down

0 comments on commit 7ec6170

Please sign in to comment.