[PATCH 10/10] d3dx9: Add NULL mesh parameter test to D3DXCreateBox.
Misha Koshelev
misha680 at gmail.com
Fri Jul 16 17:21:08 CDT 2010
---
dlls/d3dx9_36/mesh.c | 2 +-
dlls/d3dx9_36/tests/mesh.c | 3 +++
2 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/dlls/d3dx9_36/mesh.c b/dlls/d3dx9_36/mesh.c
index 53a978a..c602702 100644
--- a/dlls/d3dx9_36/mesh.c
+++ b/dlls/d3dx9_36/mesh.c
@@ -333,7 +333,7 @@ HRESULT WINAPI D3DXCreateBox(LPDIRECT3DDEVICE9 device, FLOAT width, FLOAT height
{
TRACE("(%p, %f, %f, %f, %p, %p)\n", device, width, height, depth, mesh, adjacency);
- if ( device == NULL || width == 0.0f || height == 0.0f || depth == 0.0f )
+ if ( device == NULL || width == 0.0f || height == 0.0f || depth == 0.0f || mesh == NULL )
{
return D3DERR_INVALIDCALL;
}
diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
index 45584a9..c649eba 100644
--- a/dlls/d3dx9_36/tests/mesh.c
+++ b/dlls/d3dx9_36/tests/mesh.c
@@ -525,6 +525,9 @@ static void D3DXCreateBoxTest(void)
hr = D3DXCreateBox(NULL, 0.0f, 0.0f, 1.0f, NULL, NULL);
ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
+ hr = D3DXCreateBox(NULL, 1.0f, 1.0f, 1.0f, NULL, NULL);
+ ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3DERR_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
+
wnd = CreateWindow("static", "d3dx9_test", 0, 0, 0, 0, 0, NULL, NULL, NULL, NULL);
d3d = Direct3DCreate9(D3D_SDK_VERSION);
if (!wnd)
--
1.7.1
More information about the wine-patches
mailing list