dx9: don't crash if creating a boxart texture fails. log and skip tex

Fix for MINIDUMP-5Q
This commit is contained in:
Flyinghead 2023-01-24 14:52:55 +01:00
parent bbff377ceb
commit f7e227a4aa
1 changed files with 7 additions and 1 deletions

View File

@ -65,7 +65,13 @@ public:
{
ComPtr<IDirect3DTexture9>& texture = textures[name];
texture.reset();
theDXContext.getDevice()->CreateTexture(width, height, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &texture.get(), 0);
HRESULT hr = theDXContext.getDevice()->CreateTexture(width, height, 1, 0, D3DFMT_A8R8G8B8, D3DPOOL_MANAGED, &texture.get(), 0);
if (FAILED(hr) || !texture)
{
WARN_LOG(RENDERER, "CreateTexture failed (%d x %d): error %x", width, height, hr);
textures.erase(name);
return ImTextureID();
}
width *= 4;