fix(ffmpeg/vulkan): destroy leaked VkImageViews during encoder uninit#728
Merged
ReenigneArcher merged 1 commit intoJul 13, 2026
Merged
Conversation
21 tasks
|
This combined with #727 seems to fix the vulkan encoder memory leak in Sunshine. |
Combined fix for two Vulkan encoder leaks: 1. CBS context: encoders never called ff_cbs_close(&enc->cbs), leaking cloned SPS/VPS/PPS structs (~1-8 MB per session). 2. VkImageView: ff_hw_base_encode_close() frees pictures without calling .free callback, leaking VkImageViews. Also reorders av_buffer_pool_uninit before base close.
neatnoise
force-pushed
the
fix-vulkan-imageview-leak
branch
from
July 13, 2026 11:30
9561a75 to
393d064
Compare
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
ff_hw_base_encode_close()frees remaining pictures viabase_encode_pic_free()without calling the encoder-specific.freecallback, leaking their VkImageViews. Also movesav_buffer_pool_uninitbefore base close so Vulkan packet buffers can be properly destroyed while the device reference is still valid.This addresses the 2 leaked VkImageViews reported via validation layers in LizardByte/Sunshine#5360 (comment).
Complements #727 (CBS context leak fix).
Type of Change
Checklist
AI Usage