silence warning, new assertion
authorBrian Paul <brian.paul@tungstengraphics.com>
Fri, 16 May 2008 16:49:44 +0000 (10:49 -0600)
committerBrian Paul <brian.paul@tungstengraphics.com>
Fri, 16 May 2008 21:16:06 +0000 (15:16 -0600)
src/mesa/shader/shader_api.c

index 08fa9a7e233e1bf50dc14877d259856ee2892bca..61d51c3871dbc7531ab0cb348962d73c14ec545b 100644 (file)
@@ -942,7 +942,7 @@ _mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
    if (shProg) {
       if (location < shProg->Uniforms->NumUniforms) {
          GLint progPos, i;
-         const struct gl_program *prog;
+         const struct gl_program *prog = NULL;
 
          progPos = shProg->Uniforms->Uniforms[location].VertPos;
          if (progPos >= 0) {
@@ -955,8 +955,11 @@ _mesa_get_uniformfv(GLcontext *ctx, GLuint program, GLint location,
             }
          }
 
-         for (i = 0; i < prog->Parameters->Parameters[progPos].Size; i++) {
-            params[i] = prog->Parameters->ParameterValues[progPos][i];
+         ASSERT(prog);
+         if (prog) {
+            for (i = 0; i < prog->Parameters->Parameters[progPos].Size; i++) {
+               params[i] = prog->Parameters->ParameterValues[progPos][i];
+            }
          }
       }
       else {