diff -ur SDL-1.2.6.orig/src/video/x11/SDL_x11modes.c SDL-1.2.6/src/video/x11/SDL_x11modes.c --- SDL-1.2.6.orig/src/video/x11/SDL_x11modes.c 2003-12-04 10:48:37.304994416 -0500 +++ SDL-1.2.6/src/video/x11/SDL_x11modes.c 2003-12-04 10:50:35.869969800 -0500 @@ -120,7 +120,7 @@ goto match; } qsort(modes, nmodes, sizeof *modes, cmpmodes); - for ( i = nmodes-1; i >= 0 ; i-- ) { + for ( i = nmodes-1; i > 0 ; i-- ) { if ( ! best_width ) { if ( (modes[i]->hdisplay >= width) && (modes[i]->vdisplay >= height) ) { diff -ur SDL-1.2.6.orig/src/video/xbios/SDL_xbios.c SDL-1.2.6/src/video/xbios/SDL_xbios.c --- SDL-1.2.6.orig/src/video/xbios/SDL_xbios.c 2003-12-04 10:48:37.333990008 -0500 +++ SDL-1.2.6/src/video/xbios/SDL_xbios.c 2003-12-04 10:50:05.694557160 -0500 @@ -402,6 +402,9 @@ { /* 8 bits -> list 0 */ /* 16 bits -> list 1 */ + if ((format->BitsPerPixel != 8) && (format->BitsPerPixel !=16)) { + return NULL; + return(SDL_modelist[(format->BitsPerPixel)>>4]); }