Check to see if the vertex declaration is null before trying to

reference it.
This commit is contained in:
Oliver Stieber 2005-07-10 18:16:13 +00:00 committed by Alexandre Julliard
parent 8bfe1dca03
commit 1b578af404
1 changed files with 3 additions and 1 deletions

View File

@ -3522,7 +3522,9 @@ HRESULT WINAPI IWineD3DDeviceImpl_SetVertexDeclaration(IWineD3DDevice* iface, IW
TRACE("(%p) : pDecl=%p\n", This, pDecl);
/* TODO: what about recording stateblocks? */
IWineD3DVertexDeclaration_AddRef(pDecl);
if (NULL != pDecl) {
IWineD3DVertexDeclaration_AddRef(pDecl);
}
if (NULL != This->updateStateBlock->vertexDecl) {
IWineD3DVertexDeclaration_Release(This->updateStateBlock->vertexDecl);
}