Mesa (staging/21.2): mesa: fix crashes in the no_error path of glUniform

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Oct 20 17:40:44 UTC 2021


Module: Mesa
Branch: staging/21.2
Commit: 2c7e1a90607399c64a2faef22bbd35c611980afe
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=2c7e1a90607399c64a2faef22bbd35c611980afe

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>
(cherry picked from commit 03186773a6bfcba3dce19ea3cc5d66afbeae0501)

---

 .pick_status.json               | 2 +-
 src/mesa/main/uniform_query.cpp | 4 +++-
 2 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/.pick_status.json b/.pick_status.json
index 63ab64e108b..3409c2491da 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -256,7 +256,7 @@
         "description": "mesa: fix crashes in the no_error path of glUniform",
         "nominated": true,
         "nomination_type": 1,
-        "resolution": 0,
+        "resolution": 1,
         "main_sha": null,
         "because_sha": "bd2662bfa1c8746dc29a7bad32a1647379f78532"
     },
diff --git a/src/mesa/main/uniform_query.cpp b/src/mesa/main/uniform_query.cpp
index 206f6a86450..236c794b119 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