[gtk/wip/chergert/glproto: 520/526] more assertions




commit 1e8900a3b91fdc39fe7d7e84fb4d285278496d36
Author: Christian Hergert <chergert redhat com>
Date:   Sat Feb 13 11:51:03 2021 -0800

    more assertions

 gsk/next/gskglcommandqueue.c | 8 ++++++++
 1 file changed, 8 insertions(+)
---
diff --git a/gsk/next/gskglcommandqueue.c b/gsk/next/gskglcommandqueue.c
index d1bea6cc46..85e4c32170 100644
--- a/gsk/next/gskglcommandqueue.c
+++ b/gsk/next/gskglcommandqueue.c
@@ -391,6 +391,10 @@ gsk_gl_command_queue_uniform_snapshot_cb (const GskGLUniformInfo *info,
 {
   GArray *uniforms = user_data;
 
+  g_assert (info != NULL);
+  g_assert (info->format > 0);
+  g_assert (location < GL_MAX_UNIFORM_LOCATIONS);
+
   /* To avoid calling g_array_set_size() a bunch in this callback,
    * we've already "set_size()" before the callback was called and
    * so we can instead be certain the size is large enough and use
@@ -662,6 +666,10 @@ apply_uniform (gconstpointer    dataptr,
                GskGLUniformInfo info,
                guint            location)
 {
+  g_assert (dataptr != NULL);
+  g_assert (info.format > 0);
+  g_assert (location < GL_MAX_UNIFORM_LOCATIONS);
+
   switch (info.format)
     {
     case GSK_GL_UNIFORM_FORMAT_1F:


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