mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-04-26 06:54:49 +00:00
vkmemory: fix allocation of sizes less than the alignment
Avoids allocating a 0-sized device memory which is invalid vulkan usage
This commit is contained in:
parent
0efd559950
commit
ae13e66639
1 changed files with 1 additions and 2 deletions
|
@ -99,8 +99,7 @@ _vk_mem_init (GstVulkanMemory * mem, GstAllocator * allocator,
|
||||||
align |= params->align;
|
align |= params->align;
|
||||||
offset = params->prefix;
|
offset = params->prefix;
|
||||||
maxsize += params->prefix + params->padding;
|
maxsize += params->prefix + params->padding;
|
||||||
if ((maxsize & align) != 0)
|
maxsize += align;
|
||||||
maxsize += ~(maxsize & align) + 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
gst_memory_init (GST_MEMORY_CAST (mem), flags, allocator, parent, maxsize,
|
gst_memory_init (GST_MEMORY_CAST (mem), flags, allocator, parent, maxsize,
|
||||||
|
|
Loading…
Reference in a new issue