mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-30 12:49:40 +00:00
vkimagememory: don't leak GstMapInfo in failure cases on _map()
This commit is contained in:
parent
074cb047ef
commit
87a35f679d
1 changed files with 6 additions and 3 deletions
|
@ -366,16 +366,19 @@ static gpointer
|
|||
_vk_image_mem_map_full (GstVulkanImageMemory * mem, GstMapInfo * info,
|
||||
gsize size)
|
||||
{
|
||||
GstMapInfo *vk_map_info = g_new0 (GstMapInfo, 1);
|
||||
info->user_data[0] = vk_map_info;
|
||||
GstMapInfo *vk_map_info;
|
||||
|
||||
/* FIXME: possible layout transformation needed */
|
||||
|
||||
if (!mem->vk_mem)
|
||||
return NULL;
|
||||
|
||||
if (!gst_memory_map ((GstMemory *) mem->vk_mem, vk_map_info, info->flags))
|
||||
vk_map_info = g_new0 (GstMapInfo, 1);
|
||||
info->user_data[0] = vk_map_info;
|
||||
if (!gst_memory_map ((GstMemory *) mem->vk_mem, vk_map_info, info->flags)) {
|
||||
g_free (vk_map_info);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return vk_map_info->data;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue