Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Severe bugfix: format->BitsPerPixel not checked in ListModes function
  • Loading branch information
pmandin committed Sep 2, 2003
1 parent 8c13130 commit a6a7401
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/video/xbios/SDL_xbios.c
Expand Up @@ -400,9 +400,19 @@ static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat)

static SDL_Rect **XBIOS_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags)
{
unsigned int numlist;

/* 8 bits -> list 0 */
/* 16 bits -> list 1 */
return(SDL_modelist[(format->BitsPerPixel)>>4]);
if (format->BitsPerPixel == 15) {
return NULL;
}

numlist = (format->BitsPerPixel)>>4;
if (numlist>1)
return NULL;

return(SDL_modelist[numlist]);
}

static void XBIOS_FreeBuffers(_THIS)
Expand Down

0 comments on commit a6a7401

Please sign in to comment.