[gtk/wip/chergert/glproto: 481/493] Add an assertion
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/wip/chergert/glproto: 481/493] Add an assertion
- Date: Fri, 19 Feb 2021 02:25:24 +0000 (UTC)
commit 478c4f621163a22b52612bab7094bba8f82ae7dd
Author: Matthias Clasen <mclasen redhat com>
Date: Wed Feb 17 00:05:09 2021 -0500
Add an assertion
Overflowing the offset field was causing misrendering in
some of the fishbowl demos at higher numbers, so add an
assertion, just in case.
gsk/next/gskgluniformstate.c | 2 ++
1 file changed, 2 insertions(+)
---
diff --git a/gsk/next/gskgluniformstate.c b/gsk/next/gskgluniformstate.c
index 73addf918f..57dd1b1a0e 100644
--- a/gsk/next/gskgluniformstate.c
+++ b/gsk/next/gskgluniformstate.c
@@ -152,6 +152,8 @@ setup_info:
uniform_sizes[format] * MAX (1, array_count),
&offset);
+ g_assert (offset < (1 << 20)); /* we have 20 bits for offset */
+
info->info.format = format;
info->info.offset = offset;
info->info.array_count = array_count;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]