diff options
author | Török Edvin <[email protected]> | 2010-09-04 13:48:24 +0300 |
---|---|---|
committer | Ian Romanick <[email protected]> | 2010-09-07 12:27:07 -0700 |
commit | c47b289972a6c5ca0e30ff5618418e5ca91bd1ec (patch) | |
tree | a3ae5456ffd3a84758b9cd9d6805bde7d5648ad9 /src/glsl/linker.cpp | |
parent | 3ea3f5e0a542cfd9f9a3433515fd27e0a5d1b1ac (diff) |
glsl2: check for _NumLinkedShaders being 0
Otherwise spring 0.82+.4.0 crashes when starting a game
because prog->_LinkedShaders[0] is NULL.
This also fixes piglit test cases glsl-link-empty-prog-0[12].
Diffstat (limited to 'src/glsl/linker.cpp')
-rw-r--r-- | src/glsl/linker.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp index e0823c3af42..02c7c298783 100644 --- a/src/glsl/linker.cpp +++ b/src/glsl/linker.cpp @@ -1476,7 +1476,7 @@ link_shaders(GLcontext *ctx, struct gl_shader_program *prog) assign_uniform_locations(prog); - if (prog->_LinkedShaders[0]->Type == GL_VERTEX_SHADER) { + if (prog->_NumLinkedShaders && prog->_LinkedShaders[0]->Type == GL_VERTEX_SHADER) { /* FINISHME: The value of the max_attribute_index parameter is * FINISHME: implementation dependent based on the value of * FINISHME: GL_MAX_VERTEX_ATTRIBS. GL_MAX_VERTEX_ATTRIBS must be |