From 35ed828bc28c042b35d5f627c0cfb94565d2a6da Mon Sep 17 00:00:00 2001 From: fryshorts Date: Tue, 13 Jan 2015 22:22:39 +0100 Subject: [PATCH] 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. --- plugins/linux-capture/xcursor.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugins/linux-capture/xcursor.c b/plugins/linux-capture/xcursor.c index 52e72503c..dca1af364 100644 --- a/plugins/linux-capture/xcursor.c +++ b/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);