}
}
+ if (totalLen == 0)
+ return NULL;
+
source = (GLchar *) _mesa_malloc(totalLen + 1);
if (!source)
return NULL;
*/
shader = concat_shaders(shProg, type);
- _slang_compile(ctx, shader);
+ if (shader) {
+ _slang_compile(ctx, shader);
- /* Finally, check if recompiling failed */
- if (!shader->CompileStatus ||
- !shader->Main ||
- shader->UnresolvedRefs) {
- link_error(shProg, "Unresolved symbols");
- return NULL;
+ /* Finally, check if recompiling failed */
+ if (!shader->CompileStatus ||
+ !shader->Main ||
+ shader->UnresolvedRefs) {
+ link_error(shProg, "Unresolved symbols");
+ return NULL;
+ }
}
return shader;
GLhandleARB programObj,
struct gl_shader_program *shProg)
{
- const struct gl_vertex_program *vertProg;
- const struct gl_fragment_program *fragProg;
+ const struct gl_vertex_program *vertProg = NULL;
+ const struct gl_fragment_program *fragProg = NULL;
GLuint numSamplers = 0;
GLuint i;