1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2024-11-29 01:24:11 +01:00

[d3d9] Validate RT parent device during SetRenderTarget

This commit is contained in:
WinterSnowfall 2024-11-20 17:13:18 +02:00 committed by Robin Kertels
parent 77020760f1
commit 97ad37e409

View File

@ -1592,7 +1592,12 @@ namespace dxvk {
IDirect3DSurface9* pRenderTarget) {
D3D9DeviceLock lock = LockDevice();
if (unlikely((pRenderTarget == nullptr && RenderTargetIndex == 0)))
if (unlikely(pRenderTarget == nullptr && RenderTargetIndex == 0))
return D3DERR_INVALIDCALL;
// We need to make sure the render target was created using this device.
D3D9Surface* rt = static_cast<D3D9Surface*>(pRenderTarget);
if (unlikely(rt != nullptr && rt->GetDevice() != this))
return D3DERR_INVALIDCALL;
return SetRenderTargetInternal(RenderTargetIndex, pRenderTarget);