--- a/src/video/SDL_video.c Tue Aug 20 00:27:37 2002 +0000
+++ b/src/video/SDL_video.c Tue Aug 20 04:44:36 2002 +0000
@@ -362,7 +362,7 @@
if ( bpp < 8 || bpp > 32 ) {
return(0);
}
- if ( (width == 0) || (height == 0) ) {
+ if ( (width <= 0) || (height <= 0) ) {
return(0);
}
@@ -415,8 +415,13 @@
SDL_PixelFormat format;
SDL_Rect **sizes;
+ /* Check parameters */
+ if ( *BitsPerPixel < 8 || *BitsPerPixel > 32 ) {
+ SDL_SetError("Invalid bits per pixel (range is {8...32})");
+ return(0);
+ }
if ((*w <= 0) || (*h <= 0)) {
- SDL_SetError("Invalid parameter");
+ SDL_SetError("Invalid width or height");
return(0);
}