SDL-1.2: fix dynamic bpp-target when checking for supported video modes

From eeac82f364fd3ebd7bb78b118c6a6cc9ecb49bb3 Mon Sep 17 00:00:00 2001
From: pionere <[EMAIL REDACTED]>
Date: Sun, 2 Jan 2022 18:19:37 +0100
Subject: [PATCH] fix dynamic bpp-target when checking for supported video
 modes

---
 src/video/SDL_video.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c
index ba27a008..f7e48851 100644
--- a/src/video/SDL_video.c
+++ b/src/video/SDL_video.c
@@ -399,7 +399,7 @@ int SDL_VideoModeOK (int width, int height, int bpp, Uint32 flags)
 	supported = 0;
 	table = ((bpp+7)/8)-1;
 	SDL_closest_depths[table][0] = bpp;
-	SDL_closest_depths[table][7] = 0;
+	SDL_closest_depths[table][6] = 0;
 	for ( b = 0; !supported && SDL_closest_depths[table][b]; ++b ) {
 		format.BitsPerPixel = SDL_closest_depths[table][b];
 		sizes = SDL_ListModes(&format, flags);
@@ -471,7 +471,7 @@ static int SDL_GetVideoMode (int *w, int *h, int *BitsPerPixel, Uint32 flags)
 	supported = 0;
 	table = ((*BitsPerPixel+7)/8)-1;
 	SDL_closest_depths[table][0] = *BitsPerPixel;
-	SDL_closest_depths[table][7] = SDL_VideoSurface->format->BitsPerPixel;
+	SDL_closest_depths[table][6] = SDL_VideoSurface->format->BitsPerPixel;
 	for ( b = 0; !supported && SDL_closest_depths[table][b]; ++b ) {
 		int best;