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/VertexLoader_Position.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/VertexLoader_Position.cpp')
| -rw-r--r-- | Source/Core/VideoCommon/VertexLoader_Position.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/Source/Core/VideoCommon/VertexLoader_Position.cpp b/Source/Core/VideoCommon/VertexLoader_Position.cpp index 946dacdde1..27ea61ea30 100644 --- a/Source/Core/VideoCommon/VertexLoader_Position.cpp +++ b/Source/Core/VideoCommon/VertexLoader_Position.cpp @@ -71,7 +71,7 @@ void Pos_ReadIndex(VertexLoader* loader) } using ComponentCountRow = Common::EnumMap<TPipelineFunction, CoordComponentCount::XYZ>; -using ComponentFormatTable = Common::EnumMap<ComponentCountRow, ComponentFormat::Float>; +using ComponentFormatTable = Common::EnumMap<ComponentCountRow, ComponentFormat::InvalidFloat7>; using Table = Common::EnumMap<ComponentFormatTable, VertexComponentFormat::Index16>; constexpr Table s_table_read_position = { @@ -81,6 +81,9 @@ constexpr Table s_table_read_position = { ComponentCountRow(nullptr, nullptr), ComponentCountRow(nullptr, nullptr), ComponentCountRow(nullptr, nullptr), + ComponentCountRow(nullptr, nullptr), + ComponentCountRow(nullptr, nullptr), + ComponentCountRow(nullptr, nullptr), }), ComponentFormatTable({ ComponentCountRow(Pos_ReadDirect<u8, 2>, Pos_ReadDirect<u8, 3>), @@ -88,6 +91,9 @@ constexpr Table s_table_read_position = { ComponentCountRow(Pos_ReadDirect<u16, 2>, Pos_ReadDirect<u16, 3>), ComponentCountRow(Pos_ReadDirect<s16, 2>, Pos_ReadDirect<s16, 3>), ComponentCountRow(Pos_ReadDirect<float, 2>, Pos_ReadDirect<float, 3>), + ComponentCountRow(Pos_ReadDirect<float, 2>, Pos_ReadDirect<float, 3>), + ComponentCountRow(Pos_ReadDirect<float, 2>, Pos_ReadDirect<float, 3>), + ComponentCountRow(Pos_ReadDirect<float, 2>, Pos_ReadDirect<float, 3>), }), ComponentFormatTable({ ComponentCountRow(Pos_ReadIndex<u8, u8, 2>, Pos_ReadIndex<u8, u8, 3>), @@ -95,6 +101,9 @@ constexpr Table s_table_read_position = { ComponentCountRow(Pos_ReadIndex<u8, u16, 2>, Pos_ReadIndex<u8, u16, 3>), ComponentCountRow(Pos_ReadIndex<u8, s16, 2>, Pos_ReadIndex<u8, s16, 3>), ComponentCountRow(Pos_ReadIndex<u8, float, 2>, Pos_ReadIndex<u8, float, 3>), + ComponentCountRow(Pos_ReadIndex<u8, float, 2>, Pos_ReadIndex<u8, float, 3>), + ComponentCountRow(Pos_ReadIndex<u8, float, 2>, Pos_ReadIndex<u8, float, 3>), + ComponentCountRow(Pos_ReadIndex<u8, float, 2>, Pos_ReadIndex<u8, float, 3>), }), ComponentFormatTable({ ComponentCountRow(Pos_ReadIndex<u16, u8, 2>, Pos_ReadIndex<u16, u8, 3>), @@ -102,6 +111,9 @@ constexpr Table s_table_read_position = { ComponentCountRow(Pos_ReadIndex<u16, u16, 2>, Pos_ReadIndex<u16, u16, 3>), ComponentCountRow(Pos_ReadIndex<u16, s16, 2>, Pos_ReadIndex<u16, s16, 3>), ComponentCountRow(Pos_ReadIndex<u16, float, 2>, Pos_ReadIndex<u16, float, 3>), + ComponentCountRow(Pos_ReadIndex<u16, float, 2>, Pos_ReadIndex<u16, float, 3>), + ComponentCountRow(Pos_ReadIndex<u16, float, 2>, Pos_ReadIndex<u16, float, 3>), + ComponentCountRow(Pos_ReadIndex<u16, float, 2>, Pos_ReadIndex<u16, float, 3>), }), }; } // Anonymous namespace |
