[fix] fix crash when switching monitors due to race condition and missing bounds checks in screen capturer

This commit is contained in:
dijunkun
2026-06-26 14:44:30 +08:00
parent 3c4000bdbb
commit 9c28cd2ab2
4 changed files with 22 additions and 4 deletions
@@ -72,6 +72,7 @@ class ScreenCapturerDxgi : public ScreenCapturer {
std::thread thread_;
int fps_ = 60;
cb_desktop_data callback_ = nullptr;
std::mutex switch_mutex_;
unsigned char* nv12_frame_ = nullptr;
int nv12_width_ = 0;