summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2007-10-30 18:36:05 +0100
committerMichel Dänzer <[email protected]>2007-10-30 18:40:55 +0100
commit2f496ff9574ad99f8d85b5d63e97b15faf5aee39 (patch)
tree300ae6414a48e51559950e5a4befdd09bdf843ef /src
parentab3f6015aa7227da3137b60456deb3905680f95f (diff)
tgsi_translate_mesa_program: Don't crash when program->Parameters == NULL.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/state_tracker/st_mesa_to_tgsi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c
index 36b41ea7e89..ab7aa504a1d 100644
--- a/src/mesa/state_tracker/st_mesa_to_tgsi.c
+++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c
@@ -792,7 +792,8 @@ tgsi_translate_mesa_program(
}
/* immediates/literals */
- for (i = 0; i < program->Parameters->NumParameters; i++) {
+ for (i = 0; program->Parameters && i < program->Parameters->NumParameters;
+ i++) {
if (program->Parameters->Parameters[i].Type == PROGRAM_CONSTANT) {
struct tgsi_full_immediate fullimm
= make_immediate(program->Parameters->ParameterValues[i],