Sanity check the window width and height
authorSam Lantinga
Sun, 22 Jan 2012 23:51:46 -0500
changeset 6266a4be1e781020
parent 6265 01bf72bcad1e
child 6267 ed2cf4669e55
Sanity check the window width and height
src/video/SDL_video.c
     1.1 --- a/src/video/SDL_video.c	Sun Jan 22 23:36:59 2012 -0500
     1.2 +++ b/src/video/SDL_video.c	Sun Jan 22 23:51:46 2012 -0500
     1.3 @@ -1145,6 +1145,14 @@
     1.4          }
     1.5      }
     1.6  
     1.7 +    /* Some platforms can't create zero-sized windows */
     1.8 +    if (w < 1) {
     1.9 +        w = 1;
    1.10 +    }
    1.11 +    if (h < 1) {
    1.12 +        h = 1;
    1.13 +    }
    1.14 +
    1.15      /* Some platforms have OpenGL enabled by default */
    1.16  #if (SDL_VIDEO_OPENGL && __MACOSX__) || __IPHONEOS__ || __ANDROID__
    1.17      flags |= SDL_WINDOW_OPENGL;