summaryrefslogtreecommitdiff
blob: 1b94689f63e00c8ef7efa275fb635643aeea60cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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]);
 }