[gtk/wip/chergert/glproto] add back check for invalid location
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto] add back check for invalid location
- Date: Wed, 17 Feb 2021 16:32:20 +0000 (UTC)
commit b450615aa8e5a8f809fba959733fcc8efe852a58
Author: Christian Hergert <chergert redhat com>
Date: Wed Feb 17 08:32:06 2021 -0800
add back check for invalid location
gsk/next/gskgluniformstateprivate.h | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/gsk/next/gskgluniformstateprivate.h b/gsk/next/gskgluniformstateprivate.h
index 35b5bcfbaf..32e0413730 100644
--- a/gsk/next/gskgluniformstateprivate.h
+++ b/gsk/next/gskgluniformstateprivate.h
@@ -165,7 +165,10 @@ gsk_gl_uniform_state_get_value (GskGLUniformState *state,
guint stamp,
GskGLUniformInfoElement **infoptr)
{
- GskGLUniformInfoElement *info = &program->uniforms[location];
+ GskGLUniformInfoElement *info;
+
+ if (location == (guint)-1)
+ return NULL;
/* If the stamp is the same, then we can ignore the request
* and short-circuit as early as possible. This requires the
@@ -176,6 +179,7 @@ gsk_gl_uniform_state_get_value (GskGLUniformState *state,
* modelview, clip, etc to avoid so many comparisons which cost
* considerable CPU.
*/
+ info = &program->uniforms[location];
if (stamp != 0 && stamp == info->stamp)
return NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]