tgsi_translate_mesa_program: Don't crash when program->Parameters == NULL.
authorMichel Dänzer <michel@tungstengraphics.com>
Tue, 30 Oct 2007 17:36:05 +0000 (18:36 +0100)
committerMichel Dänzer <michel@tungstengraphics.com>
Tue, 30 Oct 2007 17:40:55 +0000 (18:40 +0100)
src/mesa/state_tracker/st_mesa_to_tgsi.c

index 36b41ea7e89e3dfeb6f1bf3ae67771d3ec6a5522..ab7aa504a1db6fd6f8cd7bb661524474817cd989 100644 (file)
@@ -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],