From: Brian Paul Date: Wed, 17 Dec 2008 20:58:05 +0000 (-0700) Subject: util: check for frag/vertShader=0 before attaching X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7d41f10605c9e31b8d427f9f63f6505b187ac637;p=mesa.git util: check for frag/vertShader=0 before attaching --- diff --git a/progs/util/shaderutil.c b/progs/util/shaderutil.c index 745851395a7..2f1c4e38b30 100644 --- a/progs/util/shaderutil.c +++ b/progs/util/shaderutil.c @@ -6,6 +6,7 @@ */ +#include #include #include #include @@ -106,8 +107,12 @@ LinkShaders(GLuint vertShader, GLuint fragShader) { GLuint program = glCreateProgram_func(); - glAttachShader_func(program, fragShader); - glAttachShader_func(program, vertShader); + assert(vertShader || fragShader); + + if (fragShader) + glAttachShader_func(program, fragShader); + if (vertShader) + glAttachShader_func(program, vertShader); glLinkProgram_func(program); /* check link */