Skip to content

Commit

Permalink
don't allow to set palette to surface that isn't 8bpp
Browse files Browse the repository at this point in the history
  • Loading branch information
FunkyFr3sh committed Dec 16, 2024
1 parent 82386fb commit 018d49c
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ddsurface.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 018d49c

Please sign in to comment.