Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Sanity check the window width and height
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 23, 2012
1 parent c0eba1c commit bc0b07c
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/video/SDL_video.c
Expand Up @@ -1145,6 +1145,14 @@ SDL_CreateWindow(const char *title, int x, int y, int w, int h, Uint32 flags)
}
}

/* Some platforms can't create zero-sized windows */
if (w < 1) {
w = 1;
}
if (h < 1) {
h = 1;
}

/* Some platforms have OpenGL enabled by default */
#if (SDL_VIDEO_OPENGL && __MACOSX__) || __IPHONEOS__ || __ANDROID__
flags |= SDL_WINDOW_OPENGL;
Expand Down

0 comments on commit bc0b07c

Please sign in to comment.