material: Avoid possibly reading invalid memory
in _cogl_material_prune_empty_layer_difference we sometimes unref the given layer before dereferencing it to get a pointer to its parent. This defers the unref until after we have fetched the parent pointer.
This commit is contained in:
parent
e33a94bff4
commit
de1f4885dd
1 changed files with 1 additions and 1 deletions
|
@ -1941,8 +1941,8 @@ _cogl_material_prune_empty_layer_difference (CoglMaterial *layers_authority,
|
|||
if (layer_parent->index == layer->index && layer_parent->owner == NULL)
|
||||
{
|
||||
cogl_handle_ref (layer_parent);
|
||||
cogl_handle_unref (layer);
|
||||
link->data = layer->parent;
|
||||
cogl_handle_unref (layer);
|
||||
recursively_free_layer_caches (layers_authority);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue