[gtk/wip/chergert/glproto: 484/493] add back check for invalid location




commit 7744dac3366035b0ba0d14d40c686cdb265f7e27
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]