From 2c7e1a90607399c64a2faef22bbd35c611980afe 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: (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.