Selaa lähdekoodia

libobs: Fix bug with filter bypassing

Due to a bad 'if' expression, when a filter that is not last in the
chain is disabled or being bypassed, it ends up still calling the
filter's video processing function unintentionally.

This fix makes sure that it only calls the appropriate render functions
if the next filter target is the source, otherwise it will just call
obs_source_video_render to process the next filter in the chain.

How to replicate the bug:
1. Create two crop filters on the same source
2. Give each crop filter a different distinct value
3. Disable both crop filters
4. The image would still be cropped
jp9000 10 vuotta sitten
vanhempi
sitoutus
095159c23a
1 muutettua tiedostoa jossa 11 lisäystä ja 8 poistoa
  1. 11 8
      libobs/obs-source.c

+ 11 - 8
libobs/obs-source.c

@@ -2243,14 +2243,17 @@ void obs_source_skip_video_filter(obs_source_t *filter)
 	async = (parent_flags & OBS_SOURCE_ASYNC) != 0;
 	use_matrix = !!(parent_flags & OBS_SOURCE_COLOR_MATRIX);
 
-	if (target == parent && !custom_draw && !async)
-		obs_source_default_render(target, use_matrix);
-	else if (target->info.video_render)
-		obs_source_main_render(target);
-	else if (target->filter_target)
-		obs_source_video_render(target->filter_target);
-	else
-		obs_source_render_async_video(target);
+	if (target == parent) {
+		if (!custom_draw && !async)
+			obs_source_default_render(target, use_matrix);
+		else if (target->info.video_render)
+			obs_source_main_render(target);
+		else
+			obs_source_render_async_video(target);
+
+	} else {
+		obs_source_video_render(target);
+	}
 }
 
 signal_handler_t *obs_source_get_signal_handler(const obs_source_t *source)