mirror of
https://github.com/brl/mutter.git
synced 2024-11-25 01:20:42 -05:00
cogl/texture-2d-sliced: Don't double-free slice array when alloc failed
If texture allocation failed for a sliced 2D texture, the alloc() function would free the slices immediately, but not clear the pointer to the slices array. When the code attempting to allocate the texture then freed the texture object, the cleanup functions tried to free the slices array again, since it wasn't NULL. Fix this by clearing the slices array after freeing it. Closes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1580 Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1648>
This commit is contained in:
parent
ae6d83fb47
commit
96842fc570
@ -760,6 +760,7 @@ free_slices (CoglTexture2DSliced *tex_2ds)
|
||||
}
|
||||
|
||||
g_array_free (tex_2ds->slice_textures, TRUE);
|
||||
tex_2ds->slice_textures = NULL;
|
||||
}
|
||||
|
||||
free_spans (tex_2ds);
|
||||
|
Loading…
Reference in New Issue
Block a user