From 2616b57533e6c69f35188326b57f370633d6afe0 Mon Sep 17 00:00:00 2001 From: Christian Costa Date: Sat, 20 Mar 2004 02:33:00 +0000 Subject: [PATCH] AddRef texture only if there is one for the requested stage. --- dlls/d3d8/device.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 75fe66b0fc0..8bc2777b599 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -3028,7 +3028,8 @@ HRESULT WINAPI IDirect3DDevice8Impl_GetTexture(LPDIRECT3DDEVICE8 iface, DWORD 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) {