1
0
mirror of https://github.com/FunkyFr3sh/cnc-ddraw.git synced 2025-03-14 22:03:27 +01:00

don't allow to set palette to surface that isn't 8bpp

This commit is contained in:
FunkyFr3sh 2024-12-16 07:18:10 +01:00
parent 82386fbbc4
commit 018d49ce36

View File

@ -1091,6 +1091,9 @@ HRESULT dds_SetColorKey(IDirectDrawSurfaceImpl* This, DWORD dwFlags, LPDDCOLORKE
HRESULT dds_SetPalette(IDirectDrawSurfaceImpl* This, IDirectDrawPaletteImpl* lpDDPalette)
{
if (This->bpp != 8)
return DDERR_INVALIDPIXELFORMAT;
if (lpDDPalette)
IDirectDrawPalette_AddRef(lpDDPalette);