From fca6f42d36a2a0d92f8d2fd5e6296d210397ee52 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Mon, 11 Mar 2024 10:20:43 +0100 Subject: [PATCH] vcap/syphon: handle shader compile err reasonably The init function is used also in probe, which means that the assert will also aborts capabilities probe for the GUI. --- src/video_capture/syphon.m | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/video_capture/syphon.m b/src/video_capture/syphon.m index 144a013cf..ed84e254f 100644 --- a/src/video_capture/syphon.m +++ b/src/video_capture/syphon.m @@ -427,7 +427,11 @@ static int vidcap_syphon_init_common(char *opts, struct state_vidcap_syphon **ou if (!s->use_rgb) { s->program_to_yuv422 = glsl_compile_link(NULL, fp_display_rgba_to_yuv422_legacy); - assert(s->program_to_yuv422 != 0); + if (s->program_to_yuv422 == 0) { + MSG(ERROR, "Cannot compile shader for YUV 4:2:2 conversion!\n"); + vidcap_syphon_done(s); + return VIDCAP_INIT_FAIL; + } glUseProgram(s->program_to_yuv422); glUniform1i(glGetUniformLocation(s->program_to_yuv422, "image"), 0); }