Skip to content

Commit

Permalink
win-capture: Fix leaking framebuffers data
Browse files Browse the repository at this point in the history
The wrong linked list was used when removing framebuffer data.
Furthermore, a pointer referenced an object on the stack that
was no more valid.
  • Loading branch information
Carl Pédimina authored and Lain-B committed Jul 25, 2023
1 parent 4b1ba4e commit 4956d32
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion plugins/win-capture/graphics-hook-ver.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

#define HOOK_VER_MAJOR 1
#define HOOK_VER_MINOR 8
#define HOOK_VER_PATCH 1
#define HOOK_VER_PATCH 2

#ifndef STRINGIFY
#define STRINGIFY(s) #s
Expand Down
8 changes: 4 additions & 4 deletions plugins/win-capture/graphics-hook/vulkan-capture.c
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ static void remove_free_framebuffer_data(struct vk_data *data,
const VkAllocationCallbacks *ac)
{
struct vk_swap_data *const framebuffer_data =
(struct vk_swap_data *)remove_obj_data(&data->swaps,
(struct vk_swap_data *)remove_obj_data(&data->framebuffers,
(uint64_t)framebuffer);
vk_free(ac, framebuffer_data);
}
Expand Down Expand Up @@ -2100,8 +2100,8 @@ OBS_CmdBeginRenderPass(VkCommandBuffer commandBuffer,
{
struct vk_data *const data =
get_device_data_by_command_buffer(commandBuffer);
VkRenderPassBeginInfo alternateBegin;
if (data->valid) {
VkRenderPassBeginInfo alternateBegin;
pRenderPassBegin = process_render_pass_begin_info(
pRenderPassBegin, &alternateBegin, data);
}
Expand All @@ -2117,8 +2117,8 @@ OBS_CmdBeginRenderPass2KHR(VkCommandBuffer commandBuffer,
{
struct vk_data *const data =
get_device_data_by_command_buffer(commandBuffer);
VkRenderPassBeginInfo alternateBegin;
if (data->valid) {
VkRenderPassBeginInfo alternateBegin;
pRenderPassBegin = process_render_pass_begin_info(
pRenderPassBegin, &alternateBegin, data);
}
Expand All @@ -2134,8 +2134,8 @@ OBS_CmdBeginRenderPass2(VkCommandBuffer commandBuffer,
{
struct vk_data *const data =
get_device_data_by_command_buffer(commandBuffer);
VkRenderPassBeginInfo alternateBegin;
if (data->valid) {
VkRenderPassBeginInfo alternateBegin;
pRenderPassBegin = process_render_pass_begin_info(
pRenderPassBegin, &alternateBegin, data);
}
Expand Down

0 comments on commit 4956d32

Please sign in to comment.