From 68d895eb7c1bfefe35859bd1ba564e6708c19510 Mon Sep 17 00:00:00 2001 From: Jesse Buhagiar Date: Thu, 19 Aug 2021 21:16:17 +1000 Subject: [PATCH] LibGL: Don't crash on invalid pname value in glGetFloatv This brings `glGetFloatv` more inline with the other `glGet` functions. We should prevent crashing in the driver as much as possible and instead let the application deal with the generated GL error. --- Userland/Libraries/LibGL/SoftwareGLContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Userland/Libraries/LibGL/SoftwareGLContext.cpp b/Userland/Libraries/LibGL/SoftwareGLContext.cpp index 45511b382af23e..2045e4845dbaa9 100644 --- a/Userland/Libraries/LibGL/SoftwareGLContext.cpp +++ b/Userland/Libraries/LibGL/SoftwareGLContext.cpp @@ -1323,7 +1323,7 @@ void SoftwareGLContext::gl_get_floatv(GLenum pname, GLfloat* params) default: // FIXME: Because glQuake only requires GL_MODELVIEW_MATRIX, that is the only parameter // that we currently support. More parameters should be supported. - TODO(); + RETURN_WITH_ERROR_IF(true, GL_INVALID_ENUM); } }