src/video/SDL_video.c
changeset 456 b4e14b15af3c
parent 450 8a43e0cbf02f
child 460 a888b3ae31ff
     1.1 --- a/src/video/SDL_video.c	Tue Aug 20 00:27:37 2002 +0000
     1.2 +++ b/src/video/SDL_video.c	Tue Aug 20 04:44:36 2002 +0000
     1.3 @@ -362,7 +362,7 @@
     1.4  	if ( bpp < 8 || bpp > 32 ) {
     1.5  		return(0);
     1.6  	}
     1.7 -	if ( (width == 0) || (height == 0) ) {
     1.8 +	if ( (width <= 0) || (height <= 0) ) {
     1.9  		return(0);
    1.10  	}
    1.11  
    1.12 @@ -415,8 +415,13 @@
    1.13  	SDL_PixelFormat format;
    1.14  	SDL_Rect **sizes;
    1.15  
    1.16 +	/* Check parameters */
    1.17 +	if ( *BitsPerPixel < 8 || *BitsPerPixel > 32 ) {
    1.18 +		SDL_SetError("Invalid bits per pixel (range is {8...32})");
    1.19 +		return(0);
    1.20 +	}
    1.21  	if ((*w <= 0) || (*h <= 0)) {
    1.22 -		SDL_SetError("Invalid parameter");
    1.23 +		SDL_SetError("Invalid width or height");
    1.24  		return(0);
    1.25  	}
    1.26