提交 f23974ab 编写于 作者: J jp9000

libobs: Fix possible crash with filters

This crash happened when a filter was mistakenly used as a regular
source due to an unrelated bug in filter code and scene loading code.
The filter and the source it belongs to both had the same names, and the
source loading code found the filter and mistakenly used it as the
source instead of the actual source with the same name.
上级 cdcb8d1f
......@@ -2666,6 +2666,18 @@ void obs_source_process_filter_begin(obs_source_t *filter,
target = obs_filter_get_target(filter);
parent = obs_filter_get_parent(filter);
if (!target) {
blog(LOG_INFO, "filter '%s' being processed with no target!",
filter->context.name);
return;
}
if (!parent) {
blog(LOG_INFO, "filter '%s' being processed with no parent!",
filter->context.name);
return;
}
target_flags = target->info.output_flags;
parent_flags = parent->info.output_flags;
cx = get_base_width(target);
......@@ -2724,6 +2736,10 @@ void obs_source_process_filter_tech_end(obs_source_t *filter, gs_effect_t *effec
target = obs_filter_get_target(filter);
parent = obs_filter_get_parent(filter);
if (!target || !parent)
return;
target_flags = target->info.output_flags;
parent_flags = parent->info.output_flags;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册