diff options
author | Sam Lantinga <slouken@libsdl.org> | 2012-01-22 23:51:46 -0500 |
---|---|---|
committer | Sam Lantinga <slouken@libsdl.org> | 2012-01-22 23:51:46 -0500 |
commit | b0ce8d776ab860ebaf129e4d98728c46ae428b2c (patch) | |
tree | 4a922e172eb975777303a0c5fcb867fbced6d3c3 /src | |
parent | ae8562b561612750ea7b5ddfba19765b6d519b20 (diff) |
Sanity check the window width and height
Diffstat (limited to 'src')
-rwxr-xr-x | src/video/SDL_video.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c index 08562d58..92a5f034 100755 --- a/src/video/SDL_video.c +++ b/src/video/SDL_video.c @@ -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; |