Mesa (staging/21.3): mesa: fix crashes in the no_error path of glUniform
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Oct 19 20:59:46 UTC 2021
Module: Mesa
Branch: staging/21.3
Commit: 7420ae00f95c74ed474d302a7f2e08ea0da9626e
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=7420ae00f95c74ed474d302a7f2e08ea0da9626e
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 4c07889f564..eaa16f2e18a 100644
--- a/.pick_status.json
+++ b/.pick_status.json
@@ -202,7 +202,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 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