From: Michel Dänzer Date: Tue, 30 Oct 2007 17:36:05 +0000 (+0100) Subject: tgsi_translate_mesa_program: Don't crash when program->Parameters == NULL. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2f496ff9574ad99f8d85b5d63e97b15faf5aee39;p=mesa.git tgsi_translate_mesa_program: Don't crash when program->Parameters == NULL. --- 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],