From 03186773a6bfcba3dce19ea3cc5d66afbeae0501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= Date: Mon, 18 Oct 2021 12:39:08 -0400 Subject: [PATCH] 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 Part-of: --- 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.