mirror of
https://github.com/ggerganov/llama.cpp.git
synced 2024-12-27 06:39:25 +01:00
vulkan : initialize vk_buffer_struct members to VK_NULL_HANDLE (ggml/893)
This prevents invalid frees when destroying a partially initialized vk_buffer_struct. For example, this could happen in ggml_vk_create_buffer when running out of device memory. Co-authored-by: Tony Wasserka <neobrain@users.noreply.github.com>
This commit is contained in:
parent
d2b851bfa1
commit
203b7f1531
@ -236,8 +236,8 @@ struct vk_device_struct {
|
||||
};
|
||||
|
||||
struct vk_buffer_struct {
|
||||
vk::Buffer buffer;
|
||||
vk::DeviceMemory device_memory;
|
||||
vk::Buffer buffer = VK_NULL_HANDLE;
|
||||
vk::DeviceMemory device_memory = VK_NULL_HANDLE;
|
||||
vk::MemoryPropertyFlags memory_property_flags;
|
||||
void * ptr;
|
||||
size_t size = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user