libobs: Hold async mutex when calling set_async_texture_size

Calling set_async_texture_size without holding async_mutex is dangerous
as cur_async_frame could be changed / freed by another thread.
This commit is contained in:
Richard Stanway
2023-03-04 16:10:19 -08:00
committed by Jim
parent 0fb89dc9a1
commit 2468268569
+2 -2
View File
@@ -1225,11 +1225,11 @@ static void async_tick(obs_source_t *source)
filter_frame(source, &source->prev_async_frame);
filter_frame(source, &source->cur_async_frame);
pthread_mutex_unlock(&source->async_mutex);
if (source->cur_async_frame)
source->async_update_texture =
set_async_texture_size(source, source->cur_async_frame);
pthread_mutex_unlock(&source->async_mutex);
}
void obs_source_video_tick(obs_source_t *source, float seconds)