wined3d: Check volume texture creation errors.

Volumetexture::Release checks for NULL pointers, so releasing a partially 
created texture works.
This commit is contained in:
Stefan Dösinger 2007-02-19 15:18:45 +01:00 committed by Alexandre Julliard
parent 3f5458dc95
commit 401110538a
1 changed files with 10 additions and 2 deletions

View File

@ -939,10 +939,18 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
for (i = 0; i < object->baseTexture.levels; i++) for (i = 0; i < object->baseTexture.levels; i++)
{ {
HRESULT hr;
/* Create the volume */ /* Create the volume */
D3DCB_CreateVolume(This->parent, parent, Width, Height, Depth, Format, Pool, Usage, hr = D3DCB_CreateVolume(This->parent, parent, Width, Height, Depth, Format, Pool, Usage,
(IWineD3DVolume **)&object->volumes[i], pSharedHandle); (IWineD3DVolume **)&object->volumes[i], pSharedHandle);
if(FAILED(hr)) {
ERR("Creating a volume for the volume texture failed(%08x)\n", hr);
IWineD3DVolumeTexture_Release((IWineD3DVolumeTexture *) object);
*ppVolumeTexture = NULL;
return hr;
}
/* Set its container to this object */ /* Set its container to this object */
IWineD3DVolume_SetContainer(object->volumes[i], (IWineD3DBase *)object); IWineD3DVolume_SetContainer(object->volumes[i], (IWineD3DBase *)object);