Mesa (main): mesa: fix crashes in the no_error path of glUniform

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Tue Oct 19 16:52:30 UTC 2021


Module: Mesa
Branch: main
Commit: 03186773a6bfcba3dce19ea3cc5d66afbeae0501
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=03186773a6bfcba3dce19ea3cc5d66afbeae0501

Author: Marek Olšák <marek.olsak at amd.com>
Date:   Mon Oct 18 12:39:08 2021 -0400

mesa: fix crashes in the no_error path of glUniform

Fixes: bd2662bfa1c87 - mesa: add KHR_no_error support to glUniform*() functions

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer at amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13417>

---

 src/mesa/main/uniform_query.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index c63cacf1de7..b3413f5f676 100644
--- a/src/mesa/main/uniform_query.cpp
+++ b/src/mesa/main/uniform_query.cpp
@@ -1280,7 +1280,7 @@ _mesa_uniform(GLint location, GLsizei count, const GLvoid *values,
          return;
 
       uni = shProg->UniformRemapTable[location];
-      if (!uni)
+      if (!uni || uni == INACTIVE_UNIFORM_EXPLICIT_LOCATION)
          return;
 
       /* The array index specified by the uniform location is just the
@@ -1846,6 +1846,8 @@ _mesa_uniform_handle(GLint location, GLsizei count, const GLvoid *values,
          return;
 
       uni = shProg->UniformRemapTable[location];
+      if (!uni || uni == INACTIVE_UNIFORM_EXPLICIT_LOCATION)
+         return;
 
       /* The array index specified by the uniform location is just the
        * uniform location minus the base location of of the uniform.



More information about the mesa-commit mailing list