comparison src/video/windib/SDL_dibvideo.c @ 4096:1859647893b8 SDL-1.2

Fixed crash when given video modes > 32 bpp
author Sam Lantinga <slouken@libsdl.org>
date Thu, 27 Dec 2007 13:59:41 +0000
parents 51486c979189
children 822f9624f984
comparison
equal deleted inserted replaced
4095:f733c048a94f 4096:1859647893b8
211 SDL_Rect *mode; 211 SDL_Rect *mode;
212 int i, index; 212 int i, index;
213 int next_mode; 213 int next_mode;
214 214
215 /* Check to see if we already have this mode */ 215 /* Check to see if we already have this mode */
216 if ( bpp < 8 ) { /* Not supported */ 216 if ( bpp < 8 || bpp > 32 ) { /* Not supported */
217 return(0); 217 return(0);
218 } 218 }
219 index = ((bpp+7)/8)-1; 219 index = ((bpp+7)/8)-1;
220 for ( i=0; i<SDL_nummodes[index]; ++i ) { 220 for ( i=0; i<SDL_nummodes[index]; ++i ) {
221 mode = SDL_modelist[index][i]; 221 mode = SDL_modelist[index][i];