mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-26 21:30:09 +01:00
st/mesa: move dereference after null check
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>
This commit is contained in:
parent
ad17511302
commit
37cfc51b13
1 changed files with 3 additions and 1 deletions
|
|
@ -48,11 +48,13 @@ st_bind_images(struct st_context *st, struct gl_shader *shader,
|
|||
{
|
||||
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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue