[2/2] wined3d: IWineD3DDeviceImpl_UpdateSurface: return D3DERR_INVALIDCALL if source and dest format do not match

Fabian Bieler der.fabe at gmx.net
Fri Mar 9 04:48:25 CST 2007


-------------- next part --------------
From 1cdfd1eb4940519271147c6a1babdc339bc9ce28 Mon Sep 17 00:00:00 2001
From: Fabian Bieler <der.fabe at gmx.net>
Date: Fri, 9 Mar 2007 11:38:27 +0100
Subject: [PATCH] [2/2] wined3d: IWineD3DDeviceImpl_UpdateSurface: return D3DERR_INVALIDCALL if source and dest format do not match

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

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index cff0f19..0877a9f 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -4707,6 +4707,11 @@ static HRESULT  WINAPI  IWineD3DDeviceImpl_UpdateSurface(IWineD3DDevice *iface,
         return WINED3DERR_INVALIDCALL;
     }
 
+    if (destFormat != srcFormat) {
+        WARN("source %p and dest %p must match, returning WINED3DERR_INVALIDCALL\n", pSourceSurface, pDestinationSurface);
+        return WINED3DERR_INVALIDCALL;
+    }
+
     if (destFormat == WINED3DFMT_UNKNOWN) {
         TRACE("(%p) : Converting destination surface from WINED3DFMT_UNKNOWN to the source format\n", This);
         IWineD3DSurface_SetFormat(pDestinationSurface, srcFormat);
-- 
1.4.4.1



More information about the wine-patches mailing list