Просмотр исходного кода

linux-capture: Fix crash on missing texture

Add a check to the cursor render function to ensure the cursor texture
exists. It seems like it is very unlikely but still possible, that the
first tick which should set the texture might fail. In that case obs
would crash in the render function.
fryshorts 11 лет назад
Родитель
Сommit
35ed828bc2
1 измененных файлов с 3 добавлено и 0 удалено
  1. 3 0
      plugins/linux-capture/xcursor.c

+ 3 - 0
plugins/linux-capture/xcursor.c

@@ -99,6 +99,9 @@ void xcursor_tick(xcursor_t *data) {
 }
 
 void xcursor_render(xcursor_t *data) {
+	if (!data->tex)
+		return;
+
 	gs_effect_t *effect  = gs_get_effect();
 	gs_eparam_t *image = gs_effect_get_param_by_name(effect, "image");
 	gs_effect_set_texture(image, data->tex);