[vlc-commits] [Git][videolan/vlc][master] opengl: don't crash on no-op libplacebo shader
    Jean-Baptiste Kempf (@jbk) 
    gitlab at videolan.org
       
    Mon Nov 29 19:36:21 UTC 2021
    
    
  
Jean-Baptiste Kempf pushed to branch master at VideoLAN / VLC
Commits:
6efc345d by Niklas Haas at 2021-11-29T19:21:06+00:00
opengl: don't crash on no-op libplacebo shader
As of libplacebo 80a07bf48, the color map operation can end up as a
true no-op. In this case, this results in a blank shader with no
signature. Don't crash on this case, but simply omit the call to the
libplacebo shader entirely.
Fixes #26326
- - - - -
1 changed file:
- modules/video_output/opengl/sampler.c
Changes:
=====================================
modules/video_output/opengl/sampler.c
=====================================
@@ -786,9 +786,11 @@ opengl_fragment_shader_init(struct vlc_gl_sampler *sampler, bool expose_planes)
 #ifdef HAVE_LIBPLACEBO
     if (priv->pl_sh_res) {
         const struct pl_shader_res *res = priv->pl_sh_res;
-        assert(res->input  == PL_SHADER_SIG_COLOR);
-        assert(res->output == PL_SHADER_SIG_COLOR);
-        ADDF(" result = %s(result);\n", res->name);
+        if (res->input != PL_SHADER_SIG_NONE) {
+            assert(res->input  == PL_SHADER_SIG_COLOR);
+            assert(res->output == PL_SHADER_SIG_COLOR);
+            ADDF(" result = %s(result);\n", res->name);
+        }
     }
 #endif
 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/6efc345d81a123eb98c8c379c909179df43304ad
-- 
View it on GitLab: https://code.videolan.org/videolan/vlc/-/commit/6efc345d81a123eb98c8c379c909179df43304ad
You're receiving this email because of your account on code.videolan.org.
    
    
More information about the vlc-commits
mailing list