mirror of
https://github.com/moonlight-stream/moonlight-qt.git
synced 2026-02-16 02:30:52 +00:00
Fix double-free in Vulkan renderer when an overlay is disabled
Also a drive-by fix to avoid pl_tex copying
This commit is contained in:
@@ -806,6 +806,7 @@ void PlVkRenderer::renderFrame(AVFrame *frame)
|
|||||||
// If we have an overlay but it's been disabled, free the overlay texture
|
// If we have an overlay but it's been disabled, free the overlay texture
|
||||||
if (m_Overlays[i].hasOverlay && !Session::get()->getOverlayManager().isOverlayEnabled((Overlay::OverlayType)i)) {
|
if (m_Overlays[i].hasOverlay && !Session::get()->getOverlayManager().isOverlayEnabled((Overlay::OverlayType)i)) {
|
||||||
texturesToDestroy.push_back(m_Overlays[i].overlay.tex);
|
texturesToDestroy.push_back(m_Overlays[i].overlay.tex);
|
||||||
|
SDL_zero(m_Overlays[i].overlay);
|
||||||
m_Overlays[i].hasOverlay = false;
|
m_Overlays[i].hasOverlay = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -884,7 +885,7 @@ void PlVkRenderer::renderFrame(AVFrame *frame)
|
|||||||
|
|
||||||
UnmapExit:
|
UnmapExit:
|
||||||
// Delete any textures that need to be destroyed
|
// Delete any textures that need to be destroyed
|
||||||
for (pl_tex texture : texturesToDestroy) {
|
for (pl_tex& texture : texturesToDestroy) {
|
||||||
pl_tex_destroy(m_Vulkan->gpu, &texture);
|
pl_tex_destroy(m_Vulkan->gpu, &texture);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user