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 committed Jul 25, 2023
1 parent c58e511 commit 37333b7
Showing 1 changed file with 4 additions and 4 deletions.
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 37333b7

Please sign in to comment.