From b0cd7fe890f452668239c3eb858b637e21d33157 Mon Sep 17 00:00:00 2001 From: Alex Anderson Date: Wed, 18 Apr 2018 09:11:47 -0700 Subject: [PATCH] libobs: Fix pasting filters crash when missing sources Solves crash when a user tries to paste filters without selecting a source or when pasting filters from a deleted source. This commit checks if both sources are still valid before pasting. This addresses Mantis Issue 1220 (https://obsproject.com/mantis/view.php?id=1220). --- libobs/obs-source.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 869711738..49e58d2d4 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -427,6 +427,11 @@ static void duplicate_filters(obs_source_t *dst, obs_source_t *src, void obs_source_copy_filters(obs_source_t *dst, obs_source_t *src) { + if (!obs_source_valid(dst, "obs_source_copy_filters")) + return; + if (!obs_source_valid(src, "obs_source_copy_filters")) + return; + duplicate_filters(dst, src, dst->context.private); }