[PATCH] d3d8/tests: Avoid a crash, when CreateTexture failed
Detlef Riekenberg
wine.dev at web.de
Thu Nov 5 18:23:08 CST 2009
---
dlls/d3d8/tests/stateblock.c | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)
diff --git a/dlls/d3d8/tests/stateblock.c b/dlls/d3d8/tests/stateblock.c
index f97f910..8077681 100644
--- a/dlls/d3d8/tests/stateblock.c
+++ b/dlls/d3d8/tests/stateblock.c
@@ -1820,7 +1820,9 @@ static void resource_test_cleanup(IDirect3DDevice8 *device, struct state_test *t
for (i = 0; i < arg->tex_count; ++i)
{
- hr = IDirect3DBaseTexture8_Release(ctx->test_data_all.tex[i]);
+ /* Avoid a crash here, when CreateTexture() failed during initialization */
+ if (ctx->test_data_all.tex[i])
+ hr = IDirect3DBaseTexture8_Release(ctx->test_data_all.tex[i]);
}
HeapFree(GetProcessHeap(), 0, ctx->default_data.vb);
--
1.5.4.3
--=-3wgO/QBf4W1v2Q3lxSJv--
More information about the wine-patches
mailing list