提交 971728a1 编写于 作者: J jp9000

libobs: Fix variable being access outside of a mutex

audio_input_buf should never be accessed outside of audio_buf_mutex.
上级 d43d59ca
......@@ -3578,6 +3578,12 @@ static inline void process_audio_source_tick(obs_source_t *source,
{
pthread_mutex_lock(&source->audio_buf_mutex);
if (source->audio_input_buf[0].size < size) {
source->audio_pending = true;
pthread_mutex_unlock(&source->audio_buf_mutex);
return;
}
for (size_t ch = 0; ch < channels; ch++)
circlebuf_peek_front(&source->audio_input_buf[ch],
source->audio_output_buf[0][ch],
......@@ -3621,7 +3627,7 @@ void obs_source_audio_render(obs_source_t *source, uint32_t mixers,
return;
}
if (!source->audio_ts || source->audio_input_buf[0].size < size) {
if (!source->audio_ts) {
source->audio_pending = true;
return;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册