We should not dereference shader before we have done the
null check.
Reviewed-by: Erik Faye-Lund <kusmabite@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
{
unsigned i;
struct pipe_image_view images[MAX_IMAGE_UNIFORMS];
- struct gl_program_constants *c = &st->ctx->Const.Program[shader->Stage];
+ struct gl_program_constants *c;
if (!shader || !st->pipe->set_shader_images)
return;
+ c = &st->ctx->Const.Program[shader->Stage];
+
for (i = 0; i < shader->NumImages; i++) {
struct gl_image_unit *u = &st->ctx->ImageUnits[shader->ImageUnits[i]];
struct st_texture_object *stObj = st_texture_object(u->TexObj);