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/VideoBackends/Software/SWVertexLoader.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/VideoBackends/Software/SWVertexLoader.cpp')
| -rw-r--r-- | Source/Core/VideoBackends/Software/SWVertexLoader.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp index 903b430aff..cfb05d096b 100644 --- a/Source/Core/VideoBackends/Software/SWVertexLoader.cpp +++ b/Source/Core/VideoBackends/Software/SWVertexLoader.cpp @@ -149,11 +149,14 @@ static void ReadVertexAttribute(T* dst, DataReader src, const AttributeFormat& f dst[i_dst] = ReadNormalized<T, s16>(src.Read<s16, swap>()); break; case ComponentFormat::Float: + case ComponentFormat::InvalidFloat5: + case ComponentFormat::InvalidFloat6: + case ComponentFormat::InvalidFloat7: dst[i_dst] = ReadNormalized<T, float>(src.Read<float, swap>()); break; } - ASSERT_MSG(VIDEO, !format.integer || format.type != ComponentFormat::Float, + ASSERT_MSG(VIDEO, !format.integer || (format.type < ComponentFormat::Float), "only non-float values are allowed to be streamed as integer"); } for (; i < components; i++) |
