Sanity check the window width and height
authorSam Lantinga <slouken@libsdl.org>
Sun, 22 Jan 2012 23:51:46 -0500
changeset 6266 a4be1e781020
parent 6265 01bf72bcad1e
child 6267 ed2cf4669e55
Sanity check the window width and height
src/video/SDL_video.c
--- a/src/video/SDL_video.c	Sun Jan 22 23:36:59 2012 -0500
+++ b/src/video/SDL_video.c	Sun Jan 22 23:51:46 2012 -0500
@@ -1145,6 +1145,14 @@
         }
     }
 
+    /* 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;