comparison src/video/SDL_video.c @ 430:60effdbf14ee

Make sure width and height passed to SDL_GetVideoMode() are sane.
author Ryan C. Gordon <icculus@icculus.org>
date Thu, 01 Aug 2002 05:16:38 +0000
parents d1565c52ded5
children 706de3956894
comparison
equal deleted inserted replaced
429:c1666427297c 430:60effdbf14ee
408 int table, b, i; 408 int table, b, i;
409 int supported; 409 int supported;
410 int native_bpp; 410 int native_bpp;
411 SDL_PixelFormat format; 411 SDL_PixelFormat format;
412 SDL_Rect **sizes; 412 SDL_Rect **sizes;
413
414 if ((*w <= 0) || (*h <= 0)) {
415 SDL_SetError("Invalid parameter");
416 return(0);
417 }
413 418
414 /* Try the original video mode, get the closest depth */ 419 /* Try the original video mode, get the closest depth */
415 native_bpp = SDL_VideoModeOK(*w, *h, *BitsPerPixel, flags); 420 native_bpp = SDL_VideoModeOK(*w, *h, *BitsPerPixel, flags);
416 if ( native_bpp == *BitsPerPixel ) { 421 if ( native_bpp == *BitsPerPixel ) {
417 return(1); 422 return(1);