Skip to content

Commit

Permalink
Merge branch 'dev/jerrans/REMIX-2904' into 'main'
Browse files Browse the repository at this point in the history
[REMIX-2904] Validate the D3DTRANSFORMSTATETYPE passed to SetTransform

Closes REMIX-2904

See merge request lightspeedrtx/dxvk-remix-nv!802
  • Loading branch information
jerrans authored and nsubtil committed Apr 18, 2024
2 parents 1332ebb + 0a1e9c0 commit cc53b61
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/d3d9/d3d9_device.cpp
Expand Up @@ -1686,6 +1686,10 @@ namespace dxvk {


HRESULT STDMETHODCALLTYPE D3D9DeviceEx::SetTransform(D3DTRANSFORMSTATETYPE State, const D3DMATRIX* pMatrix) {
bool validState = (State >= D3DTS_VIEW && State <= D3DTS_PROJECTION) || (State >= D3DTS_TEXTURE0 && State <= D3DTS_TEXTURE7) || (State >= D3DTS_WORLDMATRIX(0) && State <= D3DTS_WORLDMATRIX(255));
if (!validState)
return D3DERR_INVALIDCALL;

return SetStateTransform(GetTransformIndex(State), pMatrix);
}

Expand Down

0 comments on commit cc53b61

Please sign in to comment.