[gtk+/wip/baedert/gl: 90/96] gl renderer: Avoid crashing tooltips
- From: Timm Bäder <baedert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/wip/baedert/gl: 90/96] gl renderer: Avoid crashing tooltips
- Date: Wed, 6 Dec 2017 16:37:15 +0000 (UTC)
commit e88a9dbde0f3b11e80cc18733dd403d54d2d2d74
Author: Timm Bäder <mail baedert org>
Date: Tue Dec 5 17:49:25 2017 +0100
gl renderer: Avoid crashing tooltips
gsk/gl/gskglrenderops.c | 25 ++++++++++++++-----------
1 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/gsk/gl/gskglrenderops.c b/gsk/gl/gskglrenderops.c
index 60e24fc..90c3521 100644
--- a/gsk/gl/gskglrenderops.c
+++ b/gsk/gl/gskglrenderops.c
@@ -74,19 +74,22 @@ ops_set_clip (RenderOpBuilder *builder,
RenderOp *last_op;
GskRoundedRect prev_clip;
- last_op = &g_array_index (builder->render_ops, RenderOp, builder->render_ops->len - 1);
-
- if (last_op->op == OP_CHANGE_CLIP)
- {
- last_op->clip = *clip;
- }
- else
+ if (builder->render_ops->len > 0)
{
- RenderOp op;
-
- op.op = OP_CHANGE_CLIP;
- op.clip = *clip;
- g_array_append_val (builder->render_ops, op);
+ last_op = &g_array_index (builder->render_ops, RenderOp, builder->render_ops->len - 1);
+
+ if (last_op->op == OP_CHANGE_CLIP)
+ {
+ last_op->clip = *clip;
+ }
+ else
+ {
+ RenderOp op;
+
+ op.op = OP_CHANGE_CLIP;
+ op.clip = *clip;
+ g_array_append_val (builder->render_ops, op);
+ }
}
if (builder->current_program != NULL)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]