summaryrefslogtreecommitdiff
path: root/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp
diff options
context:
space:
mode:
authorAdmiral H. Curtiss <pikachu025@gmail.com>2024-04-04 22:10:18 +0200
committerGitHub <noreply@github.com>2024-04-04 22:10:18 +0200
commitad331205d1b3c4efb41981a332c9d6fc86009ce3 (patch)
tree8ae92d26c027eaa38af74f5ba3528f5a7087b10e /Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp
parent4312840a4b8cd52ce1beee3a13ba12afe2b59e53 (diff)
parenta3951dc2d72ebb6f240d592fdbb348137130ce49 (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/OGL/OGLNativeVertexFormat.cpp')
-rw-r--r--Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp b/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp
index f1213fcde5..7e478843b6 100644
--- a/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp
+++ b/Source/Core/VideoBackends/OGL/OGLNativeVertexFormat.cpp
@@ -26,8 +26,9 @@ OGLGfx::CreateNativeVertexFormat(const PortableVertexDeclaration& vtx_decl)
static inline GLuint VarToGL(ComponentFormat t)
{
- static constexpr Common::EnumMap<GLuint, ComponentFormat::Float> lookup = {
- GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT, GL_FLOAT,
+ static constexpr Common::EnumMap<GLuint, ComponentFormat::InvalidFloat7> lookup = {
+ GL_UNSIGNED_BYTE, GL_BYTE, GL_UNSIGNED_SHORT, GL_SHORT,
+ GL_FLOAT, GL_FLOAT, GL_FLOAT, GL_FLOAT,
};
return lookup[t];
}