From e887a5346386203a05e8795e7abc6abbd7a588ba Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Sat, 27 Jul 2019 19:56:59 +0200 Subject: [PATCH] filter-sdf-effects: Fix a crash due to failed rendering For whatever reason, the initial render target render fails when an async source is being used. --- source/filters/filter-sdf-effects.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/filters/filter-sdf-effects.cpp b/source/filters/filter-sdf-effects.cpp index 97f3f8bd..bb44c08d 100644 --- a/source/filters/filter-sdf-effects.cpp +++ b/source/filters/filter-sdf-effects.cpp @@ -127,7 +127,7 @@ void filter::sdf_effects::sdf_effects_factory::on_list_fill() } try { kv.second = std::make_shared(path); - } catch (std::exception ex) { + } catch (std::exception& ex) { P_LOG_ERROR(LOG_PREFIX "Failed to load effect '%s' (located at '%s') with error(s): %s", kv.first, path, ex.what()); } @@ -866,6 +866,11 @@ void filter::sdf_effects::sdf_effects_instance::video_render(gs_effect_t* effect this->m_output_rendered = true; } + if (!this->m_output_texture) { + obs_source_skip_video_filter(this->m_self); + return; + } + gs_eparam_t* ep = gs_effect_get_param_by_name(final_effect, "image"); if (ep) { gs_effect_set_texture(ep, this->m_output_texture->get_object());