[gtk/wip/chergert/glproto: 438/493] read initial bit before unifrom data




commit b0adb229f188b0d783947280b2a0979d280e1c39
Author: Christian Hergert <chergert redhat com>
Date:   Wed Feb 10 15:34:49 2021 -0800

    read initial bit before unifrom data
    
    otherwise we do a read of unitialized data which makes valgrind sad.

 gsk/next/gskgluniformstateprivate.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gsk/next/gskgluniformstateprivate.h b/gsk/next/gskgluniformstateprivate.h
index ba9a64ffae..76fd546737 100644
--- a/gsk/next/gskgluniformstateprivate.h
+++ b/gsk/next/gskgluniformstateprivate.h
@@ -581,7 +581,7 @@ gsk_gl_uniform_state_set_texture (GskGLUniformState   *state,
 
   if ((u = gsk_gl_uniform_state_get_value (state, program, GSK_GL_UNIFORM_FORMAT_TEXTURE, 1, location, 
&info)))
     {
-      if (*u != texture_slot || info->initial)
+      if (info->initial || *u != texture_slot)
         {
           GSK_GL_UNIFORM_STATE_REPLACE (info, u, guint, 1);
           *u = texture_slot;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]