浏览代码

libobs: Prevent adding of null user sources

Not entirely sure how this happened but I *think* that a null source was
somehow being added to the list of user sources for one particular user,
and then I noticed this code does not check to see whether the source is
null or not.
jp9000 11 年之前
父节点
当前提交
457dc6520b
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      libobs/obs.c

+ 1 - 0
libobs/obs.c

@@ -777,6 +777,7 @@ bool obs_add_source(obs_source_t source)
 	struct calldata params = {0};
 	struct calldata params = {0};
 
 
 	if (!obs) return false;
 	if (!obs) return false;
+	if (!source) return false;
 
 
 	pthread_mutex_lock(&obs->data.sources_mutex);
 	pthread_mutex_lock(&obs->data.sources_mutex);
 	da_push_back(obs->data.user_sources, &source);
 	da_push_back(obs->data.user_sources, &source);