sdl12-compat: Ignore SDL_PHYSPAL if not setting it on an 8-bit screen surface.

From 8792c2f7c66ff01037673903870c5029e9955f5a Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Thu, 27 May 2021 09:38:36 -0400
Subject: [PATCH] Ignore SDL_PHYSPAL if not setting it on an 8-bit screen
 surface.

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

diff --git a/src/SDL12_compat.c b/src/SDL12_compat.c
index efece0e..6c66874 100644
--- a/src/SDL12_compat.c
+++ b/src/SDL12_compat.c
@@ -4253,8 +4253,8 @@ SDL_SetPalette(SDL12_Surface *surface12, int flags, const SDL_Color *colors,
             retval = -1;
         }
     }
-    
-    if (flags & SDL12_PHYSPAL) {
+
+    if ((flags & SDL12_PHYSPAL) && (surface12 == VideoSurface12) && VideoPhysicalPalette20) {
         if (SDL20_SetPaletteColors(VideoPhysicalPalette20, opaquecolors, firstcolor, ncolors) < 0) {
             retval = -1;
         }