Skip to content

Commit

Permalink
[d3d9] fix opCompositeExtract out of bound
Browse files Browse the repository at this point in the history
Closes: doitsujin#3293

Signed-by: Oleksii Bozhenko <oleksii.bozhenko@globallogic.com>
  • Loading branch information
AlexBozhenk committed May 4, 2023
1 parent 5c8ed49 commit f3f2a2f
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/d3d9/d3d9_fixed_function.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1169,7 +1169,7 @@ namespace dxvk {
}

uint32_t type = flags;
if (type != D3DTTFF_DISABLE) {
if (type != D3DTTFF_DISABLE && count < 4) {
if (!m_vsKey.Data.Contents.HasPositionT) {
for (uint32_t j = count; j < 4; j++) {
// If we're outside the component count of the vertex decl for this texcoord then we pad with zeroes.
Expand Down Expand Up @@ -1798,10 +1798,9 @@ namespace dxvk {
texcoord, texcoord, texcoordCnt, indices.data());

uint32_t projIdx = m_fsKey.Stages[i].Contents.ProjectedCount;
if (projIdx == 0)
if (projIdx == 0 || projIdx > texcoordCnt)
projIdx = texcoordCnt;
else
projIdx--;
--projIdx;

uint32_t projValue = 0;

Expand Down

0 comments on commit f3f2a2f

Please sign in to comment.