Skip to content

Commit

Permalink
Forgot to allocate memory for native video mode data.
Browse files Browse the repository at this point in the history
  • Loading branch information
pmandin committed Sep 20, 2009
1 parent b5cb9e3 commit 2fabc34
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/video/xbios/SDL_xbios.c
Expand Up @@ -521,11 +521,21 @@ static int XBIOS_VideoInit(_THIS, SDL_PixelFormat *vformat)
for ( i=0; i<NUM_MODELISTS; ++i ) {
int j;

SDL_xbiosmode[i] = (xbiosmode_t **)SDL_malloc(SDL_nummodes[i]*sizeof(xbiosmode_t));
SDL_xbiosmode[i] = (xbiosmode_t **)
SDL_malloc(SDL_nummodes[i]*sizeof(xbiosmode_t *));
if ( SDL_xbiosmode[i] == NULL ) {
SDL_OutOfMemory();
return(-1);
}
for ( j=0; j<SDL_nummodes[i]; ++j ) {
SDL_xbiosmode[i][j]=(xbiosmode_t *)SDL_malloc(sizeof(xbiosmode_t));
if ( SDL_xbiosmode[i][j] == NULL ) {
SDL_OutOfMemory();
return(-1);
}
SDL_memset(SDL_xbiosmode[i][j], 0, sizeof(xbiosmode_t));
}

SDL_modelist[i] = (SDL_Rect **)
SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *));
if ( SDL_modelist[i] == NULL ) {
Expand Down

0 comments on commit 2fabc34

Please sign in to comment.