Jelajahi Sumber

obs-filters: Fix scroll filter offsets becoming non-finite

If the parent source of a scroll filter has a 0 width or 0 height, the
scroll filter would do a division by zero on the size_i variable, which
would then cause the offset variable to perpetually have a non-finite
value, thus preventing the scroll filter from rendering properly after
that due to the non-finite offset value being uploaded to the shader.
jp9000 9 tahun lalu
induk
melakukan
a23d8e3f2c
1 mengubah file dengan 1 tambahan dan 1 penghapusan
  1. 1 1
      plugins/obs-filters/scroll-filter.c

+ 1 - 1
plugins/obs-filters/scroll-filter.c

@@ -166,7 +166,7 @@ static void scroll_filter_render(void *data, gs_effect_t *effect)
 	cx = filter->limit_cx ? filter->cx : base_cx;
 	cy = filter->limit_cy ? filter->cy : base_cy;
 
-	if (cx && cy) {
+	if (base_cx && base_cy) {
 		vec2_set(&filter->size_i,
 				1.0f / (float)base_cx,
 				1.0f / (float)base_cy);