Skip to content

Commit

Permalink
Take viewport X & Y coordinates into account during validation (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
WinterSnowfall authored Sep 9, 2024
1 parent 46f8e4b commit d3d0ee4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/d3d8to9_device.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ HRESULT STDMETHODCALLTYPE Direct3DDevice8::SetViewport(const D3DVIEWPORT8 *pView
{
D3DSURFACE_DESC Desc;

if (SUCCEEDED(pCurrentRenderTarget->GetDesc(&Desc)) && (pViewport->Height > Desc.Height || pViewport->Width > Desc.Width))
if (SUCCEEDED(pCurrentRenderTarget->GetDesc(&Desc)) && (pViewport->Y + pViewport->Height > Desc.Height || pViewport->X + pViewport->Width > Desc.Width))
return D3DERR_INVALIDCALL;
}

Expand Down

0 comments on commit d3d0ee4

Please sign in to comment.