Commit 4b53dde0 authored by Alexander Dorofeyev's avatar Alexander Dorofeyev Committed by Alexandre Julliard

ddraw: Make SetPalette fail for non-palettized surfaces.

parent cb9252db
......@@ -2501,6 +2501,11 @@ IDirectDrawSurfaceImpl_SetPalette(IDirectDrawSurface7 *iface,
HRESULT hr;
TRACE("(%p)->(%p)\n", This, Pal);
if (!(This->surface_desc.u4.ddpfPixelFormat.dwFlags & (DDPF_PALETTEINDEXED1 | DDPF_PALETTEINDEXED2 |
DDPF_PALETTEINDEXED4 | DDPF_PALETTEINDEXED8 | DDPF_PALETTEINDEXEDTO8))) {
return DDERR_INVALIDPIXELFORMAT;
}
/* Find the old palette */
EnterCriticalSection(&ddraw_cs);
hr = IDirectDrawSurface_GetPalette(iface, &oldPal);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment