mirror of
https://github.com/Xaymar/obs-StreamFX
synced 2024-11-28 06:13:01 +00:00
source-mirror: Fix crash with audio data on obs_shutdown (#22)
Due to the lack of checking aud and aoi, a rare race condition crash can be observed with audio mirroring enabled on closing OBS. In this case, aoi is used even though it is null, causing OBS to crash instead of closing normally. Fixes #22
This commit is contained in:
parent
b5339b4429
commit
16f55ca583
1 changed files with 6 additions and 0 deletions
|
@ -499,7 +499,13 @@ void Source::Mirror::audio_capture_cb(void*, const audio_data* audio, bool) {
|
|||
}
|
||||
|
||||
audio_t* aud = obs_get_audio();
|
||||
if (!aud) {
|
||||
return;
|
||||
}
|
||||
audio_output_info const* aoi = audio_output_get_info(aud);
|
||||
if (!aoi) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::bitset<8> layout;
|
||||
for (size_t plane = 0; plane < MAX_AV_PLANES; plane++) {
|
||||
|
|
Loading…
Reference in a new issue