[Mesa-dev] [PATCH] st/mesa: fix potential null deref if no shader is passed in
Samuel Pitoiset
samuel.pitoiset at gmail.com
Wed Feb 3 20:48:23 UTC 2016
Reviewed-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
On 02/03/2016 07:53 PM, Ilia Mirkin wrote:
> Spotted by Coverity
>
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>
> ---
> src/mesa/state_tracker/st_atom_storagebuf.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_atom_storagebuf.c b/src/mesa/state_tracker/st_atom_storagebuf.c
> index a581818..f165cc3 100644
> --- a/src/mesa/state_tracker/st_atom_storagebuf.c
> +++ b/src/mesa/state_tracker/st_atom_storagebuf.c
> @@ -46,11 +46,13 @@ st_bind_ssbos(struct st_context *st, struct gl_shader *shader,
> {
> unsigned i;
> struct pipe_shader_buffer buffers[MAX_SHADER_STORAGE_BUFFERS];
> - struct gl_program_constants *c = &st->ctx->Const.Program[shader->Stage];
> + struct gl_program_constants *c;
>
> if (!shader || !st->pipe->set_shader_buffers)
> return;
>
> + c = &st->ctx->Const.Program[shader->Stage];
> +
> for (i = 0; i < shader->NumShaderStorageBlocks; i++) {
> struct gl_shader_storage_buffer_binding *binding;
> struct st_buffer_object *st_obj;
>
More information about the mesa-dev
mailing list