[D3D8] Fix basic dereference bug

Christian Costa titan.costa at wanadoo.fr
Fri Mar 19 16:36:53 CST 2004


Hi,

This makes Star Wars Starfighter works with D3D8.

Changelog:
AddRef texture only if there is one for the requested stage.

Christian Costa   titan.costa at wanadoo.fr
-------------- next part --------------
Index: device.c
===================================================================
RCS file: /home/wine/wine/dlls/d3d8/device.c,v
retrieving revision 1.95
diff -u -r1.95 device.c
--- device.c	9 Feb 2004 22:07:43 -0000	1.95
+++ device.c	19 Mar 2004 21:28:13 -0000
@@ -3028,7 +3028,8 @@
     ICOM_THIS(IDirect3DDevice8Impl,iface);
     TRACE("(%p) : returning %p for stage %ld\n", This, This->UpdateStateBlock->textures[Stage], Stage);
     *ppTexture = (LPDIRECT3DBASETEXTURE8) This->UpdateStateBlock->textures[Stage];
-    IDirect3DBaseTexture8Impl_AddRef(*ppTexture);
+    if (*ppTexture)
+        IDirect3DBaseTexture8Impl_AddRef(*ppTexture);
     return D3D_OK;
 }
 HRESULT  WINAPI  IDirect3DDevice8Impl_SetTexture(LPDIRECT3DDEVICE8 iface, DWORD Stage, IDirect3DBaseTexture8* pTexture) {


More information about the wine-patches mailing list