mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-14 20:51:07 +00:00
snapshot: Don't crash and don't leak
We were trying to handle a NULL mask child, unsuccessfully. Pointed out by Niels De Graef.
This commit is contained in:
parent
7d3970546c
commit
346fcdb405
@ -1530,16 +1530,17 @@ gtk_snapshot_collect_mask_source (GtkSnapshot *snapshot,
|
||||
{
|
||||
GskRenderNode *source_child, *mask_child, *mask_node;
|
||||
|
||||
mask_child = gsk_render_node_ref (state->data.mask.mask_node);
|
||||
mask_child = state->data.mask.mask_node;
|
||||
source_child = gtk_snapshot_collect_default (snapshot, state, nodes, n_nodes);
|
||||
|
||||
if (source_child == NULL || mask_child == NULL)
|
||||
if (source_child == NULL)
|
||||
return NULL;
|
||||
|
||||
mask_node = gsk_mask_node_new (source_child, mask_child, state->data.mask.mask_mode);
|
||||
if (mask_child)
|
||||
mask_node = gsk_mask_node_new (source_child, mask_child, state->data.mask.mask_mode);
|
||||
else
|
||||
mask_node = NULL;
|
||||
|
||||
gsk_render_node_unref (source_child);
|
||||
gsk_render_node_unref (mask_child);
|
||||
|
||||
return mask_node;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user