From 6bec623edb06c631c100a24496e53ccb5930ea8e Mon Sep 17 00:00:00 2001 From: Jason Edmeades Date: Thu, 24 Feb 2005 10:05:06 +0000 Subject: [PATCH] Correct handling of unusual vendor strings in d3d8, and check for a stateblock before trying to release it in wined3d. --- dlls/d3d8/directx.c | 4 +++- dlls/wined3d/device.c | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/d3d8/directx.c b/dlls/d3d8/directx.c index a85a965004e..6a4e9df3649 100644 --- a/dlls/d3d8/directx.c +++ b/dlls/d3d8/directx.c @@ -264,8 +264,10 @@ static void IDirect3D8Impl_FillGLCaps(LPDIRECT3D8 iface, Display* display) { case VENDOR_ATI: major = minor = 0; gl_string_cursor = strchr(gl_string, '-'); - if (gl_string_cursor++) { + if (gl_string_cursor) { int error = 0; + gl_string_cursor++; + /* Check if version number is of the form x.y.z */ if (*gl_string_cursor > '9' && *gl_string_cursor < '0') error = 1; diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index a834d0e2f1d..36adf0c1a7d 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -3616,7 +3616,8 @@ ULONG WINAPI IWineD3DDeviceImpl_Release(IWineD3DDevice *iface) { TRACE("(%p) : Releasing from %ld\n", This, refCount + 1); if (!refCount) { - IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->stateBlock); + /*TODO: Remove me once d3d8 stateblocks are converted */ + if (This->stateBlock) IWineD3DStateBlock_Release((IWineD3DStateBlock *)This->stateBlock); IWineD3D_Release(This->wineD3D); HeapFree(GetProcessHeap(), 0, This); } -- 2.11.4.GIT