diff options
| author | Admiral H. Curtiss <pikachu025@gmail.com> | 2024-04-04 22:10:18 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-04-04 22:10:18 +0200 |
| commit | ad331205d1b3c4efb41981a332c9d6fc86009ce3 (patch) | |
| tree | 8ae92d26c027eaa38af74f5ba3528f5a7087b10e /Source/Core/VideoCommon/VertexLoaderARM64.cpp | |
| parent | 4312840a4b8cd52ce1beee3a13ba12afe2b59e53 (diff) | |
| parent | a3951dc2d72ebb6f240d592fdbb348137130ce49 (diff) | |
Merge pull request #12684 from Pokechu22/invalid-vertex-component
Fix out of bounds accesses for invalid vertex component formats
Diffstat (limited to 'Source/Core/VideoCommon/VertexLoaderARM64.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoaderARM64.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Source/Core/VideoCommon/VertexLoaderARM64.cpp b/Source/Core/VideoCommon/VertexLoaderARM64.cpp index 2198b0b427..9fd8c0c29c 100644 --- a/Source/Core/VideoCommon/VertexLoaderARM64.cpp +++ b/Source/Core/VideoCommon/VertexLoaderARM64.cpp @@ -116,7 +116,7 @@ void VertexLoaderARM64::ReadVertex(VertexComponentFormat attribute, ComponentFor m_float_emit.LDUR(load_size, coords, reg, offset); - if (format != ComponentFormat::Float) + if (format < ComponentFormat::Float) { // Extend and convert to float switch (format) @@ -394,8 +394,8 @@ void VertexLoaderARM64::GenerateVertexLoader() if (m_VtxDesc.low.Normal != VertexComponentFormat::NotPresent) { - static constexpr Common::EnumMap<u8, static_cast<ComponentFormat>(7)> SCALE_MAP = {7, 6, 15, 14, - 0, 0, 0, 0}; + static constexpr Common::EnumMap<u8, ComponentFormat::InvalidFloat7> SCALE_MAP = {7, 6, 15, 14, + 0, 0, 0, 0}; const u8 scaling_exponent = SCALE_MAP[m_VtxAttr.g0.NormalFormat]; // Normal |
