[Mesa-dev] [PATCH] st/mesa: check that the image unit is valid in st_bind_images

Marek Olšák maraeo at gmail.com
Fri Mar 11 09:57:23 UTC 2016


Reviewed-by: Marek Olšák <marek.olsak at amd.com>

Marek

On Fri, Mar 11, 2016 at 12:27 AM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> From: Nicolai Hähnle <nicolai.haehnle at amd.com>
>
> ---
>  src/mesa/state_tracker/st_atom_image.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/mesa/state_tracker/st_atom_image.c b/src/mesa/state_tracker/st_atom_image.c
> index d0f0c42..bf7486b 100644
> --- a/src/mesa/state_tracker/st_atom_image.c
> +++ b/src/mesa/state_tracker/st_atom_image.c
> @@ -25,6 +25,7 @@
>   **************************************************************************/
>
>  #include "main/imports.h"
> +#include "main/shaderimage.h"
>  #include "program/prog_parameter.h"
>  #include "program/prog_print.h"
>  #include "compiler/glsl/ir_uniform.h"
> @@ -60,7 +61,7 @@ st_bind_images(struct st_context *st, struct gl_shader *shader,
>        struct st_texture_object *stObj = st_texture_object(u->TexObj);
>        struct pipe_image_view *img = &images[i];
>
> -      if (!stObj ||
> +      if (!_mesa_is_image_unit_valid(st->ctx, u) ||
>            !st_finalize_texture(st->ctx, st->pipe, u->TexObj) ||
>            !stObj->pt) {
>           memset(img, 0, sizeof(*img));
> --
> 2.5.0
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list