Commit 86138853 authored by Ryan C. Gordon's avatar Ryan C. Gordon

Make sure width and height passed to SDL_GetVideoMode() are sane.

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%40431
parent 8a705f2f
......@@ -411,6 +411,11 @@ static int SDL_GetVideoMode (int *w, int *h, int *BitsPerPixel, Uint32 flags)
SDL_PixelFormat format;
SDL_Rect **sizes;
if ((*w <= 0) || (*h <= 0)) {
SDL_SetError("Invalid parameter");
return(0);
}
/* Try the original video mode, get the closest depth */
native_bpp = SDL_VideoModeOK(*w, *h, *BitsPerPixel, flags);
if ( native_bpp == *BitsPerPixel ) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment