summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGL
diff options
context:
space:
mode:
authorLuke Wilde <lukew@serenityos.org>2022-06-04 00:19:15 +0100
committerLinus Groh <mail@linusgroh.de>2022-06-04 22:25:16 +0100
commit971d6ce16f7ee87c1fdaf8a8cdeee286b4567aa1 (patch)
tree14eaf94795db97498af01fc564a933983d0bf802 /Userland/Libraries/LibGL
parent2a171dfc384cde5d08871652ba11763fc90c7059 (diff)
downloadserenity-971d6ce16f7ee87c1fdaf8a8cdeee286b4567aa1.zip
LibGL: Reject GL_LEFT and GL_RIGHT in glCullFace
glCullFace only accepts GL_FRONT, GL_BACK and GL_FRONT_AND_BACK. We checked if the mode was valid by performing ``` cull_mode < GL_FRONT || cull_mode > GL_FRONT_AND_BACK ``` However, this range also contains GL_LEFT and GL_RIGHT, which we would accept when we should return a GL_INVALID_ENUM error.
Diffstat (limited to 'Userland/Libraries/LibGL')
-rw-r--r--Userland/Libraries/LibGL/GLContext.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Libraries/LibGL/GLContext.cpp b/Userland/Libraries/LibGL/GLContext.cpp
index 76c6c48fd4..8fa80a2ecf 100644
--- a/Userland/Libraries/LibGL/GLContext.cpp
+++ b/Userland/Libraries/LibGL/GLContext.cpp
@@ -243,7 +243,7 @@ void GLContext::gl_cull_face(GLenum cull_mode)
{
APPEND_TO_CALL_LIST_AND_RETURN_IF_NEEDED(gl_cull_face, cull_mode);
- RETURN_WITH_ERROR_IF(cull_mode < GL_FRONT || cull_mode > GL_FRONT_AND_BACK, GL_INVALID_ENUM);
+ RETURN_WITH_ERROR_IF(cull_mode != GL_FRONT && cull_mode != GL_BACK && cull_mode != GL_FRONT_AND_BACK, GL_INVALID_ENUM);
m_culled_sides = cull_mode;