# HG changeset patch # User Patrice Mandin # Date 1253470475 0 # Node ID 7ec1d9a34164051a594a07585a4d3275f4231a43 # Parent b10a73ebd7fdef2673107e209f8a190d5fa535f6 Make the list NULL terminated. diff -r b10a73ebd7fd -r 7ec1d9a34164 src/video/xbios/SDL_xbios.c --- a/src/video/xbios/SDL_xbios.c Sun Sep 20 18:05:52 2009 +0000 +++ b/src/video/xbios/SDL_xbios.c Sun Sep 20 18:14:35 2009 +0000 @@ -522,7 +522,7 @@ int j; SDL_xbiosmode[i] = (xbiosmode_t **) - SDL_malloc(SDL_nummodes[i]*sizeof(xbiosmode_t *)); + SDL_malloc((SDL_nummodes[i]+1)*sizeof(xbiosmode_t *)); if ( SDL_xbiosmode[i] == NULL ) { SDL_OutOfMemory(); return(-1); @@ -535,6 +535,7 @@ } SDL_memset(SDL_xbiosmode[i][j], 0, sizeof(xbiosmode_t)); } + SDL_xbiosmode[i][j] = NULL; SDL_modelist[i] = (SDL_Rect **) SDL_malloc((SDL_nummodes[i]+1)*sizeof(SDL_Rect *));