Alexander Dorofeyev : ddraw: Make SetPalette fail for non-palettized surfaces.

Alexandre Julliard julliard at winehq.org
Mon Mar 24 15:21:43 CDT 2008


Module: wine
Branch: master
Commit: 4b53dde0f53020196a3a11683c6f0711c7f2a999
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=4b53dde0f53020196a3a11683c6f0711c7f2a999

Author: Alexander Dorofeyev <alexd4 at inbox.lv>
Date:   Sun Mar 23 01:59:01 2008 +0200

ddraw: Make SetPalette fail for non-palettized surfaces.

---

 dlls/ddraw/surface.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/ddraw/surface.c b/dlls/ddraw/surface.c
index ae57bb4..c48e07e 100644
--- a/dlls/ddraw/surface.c
+++ b/dlls/ddraw/surface.c
@@ -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);




More information about the wine-cvs mailing list