Mercurial > sdl-ios-xcode
comparison src/video/xbios/SDL_xbios.c @ 4201:b10a73ebd7fd SDL-1.2
Forgot to allocate memory for native video mode data.
author | Patrice Mandin <patmandin@gmail.com> |
---|---|
date | Sun, 20 Sep 2009 18:05:52 +0000 |
parents | 907624b7a72c |
children | 7ec1d9a34164 |
comparison
equal
deleted
inserted
replaced
4200:907624b7a72c | 4201:b10a73ebd7fd |
---|---|
519 } | 519 } |
520 | 520 |
521 for ( i=0; i<NUM_MODELISTS; ++i ) { | 521 for ( i=0; i<NUM_MODELISTS; ++i ) { |
522 int j; | 522 int j; |
523 | 523 |
524 SDL_xbiosmode[i] = (xbiosmode_t **)SDL_malloc(SDL_nummodes[i]*sizeof(xbiosmode_t)); | 524 SDL_xbiosmode[i] = (xbiosmode_t **) |
525 SDL_malloc(SDL_nummodes[i]*sizeof(xbiosmode_t *)); | |
525 if ( SDL_xbiosmode[i] == NULL ) { | 526 if ( SDL_xbiosmode[i] == NULL ) { |
526 SDL_OutOfMemory(); | 527 SDL_OutOfMemory(); |
527 return(-1); | 528 return(-1); |
528 } | 529 } |
530 for ( j=0; j<SDL_nummodes[i]; ++j ) { | |
531 SDL_xbiosmode[i][j]=(xbiosmode_t *)SDL_malloc(sizeof(xbiosmode_t)); | |
532 if ( SDL_xbiosmode[i][j] == NULL ) { | |
533 SDL_OutOfMemory(); | |
534 return(-1); | |
535 } | |
536 SDL_memset(SDL_xbiosmode[i][j], 0, sizeof(xbiosmode_t)); | |
537 } | |
538 | |
529 SDL_modelist[i] = (SDL_Rect **) | 539 SDL_modelist[i] = (SDL_Rect **) |
530 SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *)); | 540 SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *)); |
531 if ( SDL_modelist[i] == NULL ) { | 541 if ( SDL_modelist[i] == NULL ) { |
532 SDL_OutOfMemory(); | 542 SDL_OutOfMemory(); |
533 return(-1); | 543 return(-1); |