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.
This commit is contained in:
jp9000 2016-04-09 17:40:26 -07:00
parent cdcb8d1f81
commit f23974ab64

View File

@ -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;