Merge pull request #8913 from Robyt3/Video-Stop-ASAN-Fix

Fix heap-use-after-free in `CVideo::Stop`
This commit is contained in:
Jupeyy 2024-09-07 16:17:29 +00:00 committed by GitHub
commit 11fd82077a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -283,6 +283,7 @@ void CVideo::Pause(bool Pause)
void CVideo::Stop()
{
dbg_assert(!m_Stopped, "Already stopped");
m_Stopped = true;
m_pGraphics->WaitForIdle();
@ -341,8 +342,6 @@ void CVideo::Stop()
pSound->PauseAudioDevice();
delete ms_pCurrentVideo;
pSound->UnpauseAudioDevice();
m_Stopped = true;
}
void CVideo::NextVideoFrameThread()