mirror of
https://github.com/yawut/SDL.git
synced 2026-09-30 20:26:42 -05:00
Make sure width and height passed to SDL_GetVideoMode() are sane.
This commit is contained in:
@@ -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 ) {
|
||||
|
||||
Reference in New Issue
Block a user