comparison src/video/xbios/SDL_xbios.c @ 711:8db4098e944b

Severe bugfix: format->BitsPerPixel not checked in ListModes function
author Patrice Mandin <patmandin@gmail.com>
date Tue, 02 Sep 2003 19:49:50 +0000
parents 50dcaff875f5
children 8be92df64b22
comparison
equal deleted inserted replaced
710:86de11faf082 711:8db4098e944b
398 return(0); 398 return(0);
399 } 399 }
400 400
401 static SDL_Rect **XBIOS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags) 401 static SDL_Rect **XBIOS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
402 { 402 {
403 unsigned int numlist;
404
403 /* 8 bits -> list 0 */ 405 /* 8 bits -> list 0 */
404 /* 16 bits -> list 1 */ 406 /* 16 bits -> list 1 */
405 return(SDL_modelist[(format->BitsPerPixel)>>4]); 407 if (format->BitsPerPixel == 15) {
408 return NULL;
409 }
410
411 numlist = (format->BitsPerPixel)>>4;
412 if (numlist>1)
413 return NULL;
414
415 return(SDL_modelist[numlist]);
406 } 416 }
407 417
408 static void XBIOS_FreeBuffers(_THIS) 418 static void XBIOS_FreeBuffers(_THIS)
409 { 419 {
410 int i; 420 int i;