X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fguicast%2Fvframe3d.C;fp=cinelerra-5.1%2Fguicast%2Fvframe3d.C;h=d7d4af0a222f317bd6730cef3a3bea42c6f2b60a;hp=52f096d7fa444385895067c2bce5a2bf82bf0949;hb=c5451a0a1f2a69ffea5e8b85d05787466f355481;hpb=827586949547b489a6a842729ad01a983f3eb051 diff --git a/cinelerra-5.1/guicast/vframe3d.C b/cinelerra-5.1/guicast/vframe3d.C index 52f096d7..d7d4af0a 100644 --- a/cinelerra-5.1/guicast/vframe3d.C +++ b/cinelerra-5.1/guicast/vframe3d.C @@ -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