wined3d: Check volume texture creation errors.
Volumetexture::Release checks for NULL pointers, so releasing a partially created texture works.
This commit is contained in:
parent
3f5458dc95
commit
401110538a
|
@ -939,9 +939,17 @@ static HRESULT WINAPI IWineD3DDeviceImpl_CreateVolumeTexture(IWineD3DDevice *ifa
|
|||
|
||||
for (i = 0; i < object->baseTexture.levels; i++)
|
||||
{
|
||||
HRESULT hr;
|
||||
/* Create the volume */
|
||||
D3DCB_CreateVolume(This->parent, parent, Width, Height, Depth, Format, Pool, Usage,
|
||||
(IWineD3DVolume **)&object->volumes[i], pSharedHandle);
|
||||
hr = D3DCB_CreateVolume(This->parent, parent, Width, Height, Depth, Format, Pool, Usage,
|
||||
(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 */
|
||||
IWineD3DVolume_SetContainer(object->volumes[i], (IWineD3DBase *)object);
|
||||
|
|
Loading…
Reference in New Issue