[gtk+] snapshot: Set blend mode directly after pushing state



commit 007e4639a8404fba6e71b3e7120de7a34253c2ae
Author: Timm Bäder <mail baedert org>
Date:   Sun Oct 8 08:28:35 2017 +0200

    snapshot: Set blend mode directly after pushing state
    
    This is important since _push_state returns a pointer into a GArray
    which could be invalidated and point to garbage after the subsequent
    push_state call.

 gtk/gtksnapshot.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c
index a9a428d..5d2a7f1 100644
--- a/gtk/gtksnapshot.c
+++ b/gtk/gtksnapshot.c
@@ -823,6 +823,7 @@ gtk_snapshot_push_blend (GtkSnapshot  *snapshot,
                                        current_state->translate_x,
                                        current_state->translate_y,
                                        gtk_snapshot_collect_blend_top);
+  top_state->data.blend.blend_mode = blend_mode;
 
   gtk_snapshot_push_state (snapshot,
                            g_strdup (str),
@@ -830,7 +831,6 @@ gtk_snapshot_push_blend (GtkSnapshot  *snapshot,
                            top_state->translate_x,
                            top_state->translate_y,
                            gtk_snapshot_collect_blend_bottom);
-  top_state->data.blend.blend_mode = blend_mode;
 }
 
 static GskRenderNode *


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