Make the list NULL terminated. SDL-1.2
authorPatrice Mandin <patmandin@gmail.com>
Sun, 20 Sep 2009 18:14:35 +0000
branchSDL-1.2
changeset 42027ec1d9a34164
parent 4201 b10a73ebd7fd
child 4203 7e5486073044
Make the list NULL terminated.
src/video/xbios/SDL_xbios.c
     1.1 --- a/src/video/xbios/SDL_xbios.c	Sun Sep 20 18:05:52 2009 +0000
     1.2 +++ b/src/video/xbios/SDL_xbios.c	Sun Sep 20 18:14:35 2009 +0000
     1.3 @@ -522,7 +522,7 @@
     1.4  		int j;
     1.5  
     1.6  		SDL_xbiosmode[i] = (xbiosmode_t **)
     1.7 -			SDL_malloc(SDL_nummodes[i]*sizeof(xbiosmode_t *));
     1.8 +			SDL_malloc((SDL_nummodes[i]+1)*sizeof(xbiosmode_t *));
     1.9  		if ( SDL_xbiosmode[i] == NULL ) {
    1.10  			SDL_OutOfMemory();
    1.11  			return(-1);
    1.12 @@ -535,6 +535,7 @@
    1.13  			}
    1.14  			SDL_memset(SDL_xbiosmode[i][j], 0, sizeof(xbiosmode_t));
    1.15  		}
    1.16 +		SDL_xbiosmode[i][j] = NULL;
    1.17  
    1.18  		SDL_modelist[i] = (SDL_Rect **)
    1.19  				SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *));