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.
This commit is contained in:
fryshorts
2015-01-13 22:22:39 +01:00
parent e009c7951d
commit 35ed828bc2

View File

@@ -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);