From 2f496ff9574ad99f8d85b5d63e97b15faf5aee39 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Tue, 30 Oct 2007 18:36:05 +0100 Subject: [PATCH] tgsi_translate_mesa_program: Don't crash when program->Parameters == NULL. --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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], -- 2.30.2