diff options
author | Brian <brian.paul@tungstengraphics.com> | 2007-11-23 10:25:48 -0700 |
---|---|---|
committer | Brian <brian.paul@tungstengraphics.com> | 2007-11-23 10:25:48 -0700 |
commit | ba162438841ecc6f0227b149ded66916911d9acf (patch) | |
tree | 04e0ff95eba4f1c0aa477b775cf69b612fa865bc /src/mesa/shader/slang/slang_emit.c | |
parent | c14d969a69d7b9a060c6701d3f18c51eabc56635 (diff) |
Fix parsing of gl_FrontLightModelProduct.sceneColor, don't segfault on variable array indexes.
Diffstat (limited to 'src/mesa/shader/slang/slang_emit.c')
-rw-r--r-- | src/mesa/shader/slang/slang_emit.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/mesa/shader/slang/slang_emit.c b/src/mesa/shader/slang/slang_emit.c index 41646af387..f180fb949a 100644 --- a/src/mesa/shader/slang/slang_emit.c +++ b/src/mesa/shader/slang/slang_emit.c @@ -1486,6 +1486,10 @@ emit_struct_field(slang_emit_info *emitInfo, slang_ir_node *n) { if (n->Store->File == PROGRAM_STATE_VAR) { n->Store->Index = _slang_alloc_statevar(n, emitInfo->prog->Parameters); + if (n->Store->Index < 0) { + slang_info_log_error(emitInfo->log, "Error parsing state variable"); + return NULL; + } } else { GLint offset = n->FieldOffset / 4; |