fix make_shader segment count, repair mask tweak keyfrm updates for xlat,rotate,scale
[goodguy/cinelerra.git] / cinelerra-5.1 / guicast / vframe3d.C
index 52f096d7fa444385895067c2bce5a2bf82bf0949..d7d4af0a222f317bd6730cef3a3bea42c6f2b60a 100644 (file)
@@ -398,13 +398,16 @@ unsigned int VFrame::make_shader(const char **segments, ...)
        unsigned int program = 0;
 #ifdef HAVE_GL
 // Construct single source file out of arguments
-       int nb_segs = 1;
-       if( !segments ) {
+       int nb_segs = 0;
+       if( !segments ) {  // arg list
                va_list list;  va_start(list, segments);
                while( va_arg(list, char*) != 0 ) ++nb_segs;
                va_end(list);
        }
-       const char *segs[nb_segs];
+       else { // segment list
+               while( segments[nb_segs] ) ++nb_segs;
+       }
+       const char *segs[++nb_segs];
        if( !segments ) {
                va_list list;  va_start(list, segments);
                for( int i=0; i<nb_segs; ++i )