diff options
author | Stéphane Marchesin <[email protected]> | 2011-10-09 16:49:19 -0700 |
---|---|---|
committer | Stéphane Marchesin <[email protected]> | 2011-10-10 00:15:05 -0700 |
commit | ddba509c16c4cb0630a4f4841b31953f02be6b3f (patch) | |
tree | bffacb3a2788ea84bafaccbf65a2d366dad11b2f /src | |
parent | 0f55f133f1e5b72e463441d2d388a1ec4deac1da (diff) |
mesa/st: Check for a NULL _LinkedShader[i] before using it.
The rest of the linker/glsl translation code checks for NULL, so I suppose we should check here too. Fixes crash on exit with i915g instanced drawing.
Reviewed-by: Ian Romanick <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index acd3b56b905..c419c4066a1 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -1154,7 +1154,8 @@ destroy_shader_program_variants_cb(GLuint key, void *data, void *userData) } for (i = 0; i < Elements(shProg->_LinkedShaders); i++) { - destroy_program_variants(st, shProg->_LinkedShaders[i]->Program); + if (shProg->_LinkedShaders[i]) + destroy_program_variants(st, shProg->_LinkedShaders[i]->Program); } } break; |