[gtk/wip/chergert/glproto] clear uniform state to zero when expanding



commit de71623f4561ebd5625608e2be05e1b52fe6312f
Author: Christian Hergert <chergert redhat com>
Date:   Wed Dec 30 16:10:57 2020 -0800

    clear uniform state to zero when expanding

 gsk/next/gskgluniformstate.c | 2 ++
 1 file changed, 2 insertions(+)
---
diff --git a/gsk/next/gskgluniformstate.c b/gsk/next/gskgluniformstate.c
index 3a14d958e1..13598a14c4 100644
--- a/gsk/next/gskgluniformstate.c
+++ b/gsk/next/gskgluniformstate.c
@@ -146,10 +146,12 @@ alloc_uniform_data (GByteArray *buffer,
     {
       guint prefix_align = align - masked;
       g_byte_array_set_size (buffer, buffer->len + prefix_align);
+      memset (buffer->data + buffer->len - prefix_align, 0, prefix_align);
     }
 
   *offset = buffer->len;
   g_byte_array_set_size (buffer, buffer->len + size);
+  memset (buffer->data + buffer->len - size, 0, size);
 
   g_assert ((*offset & (align - 1)) == 0);
 


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