summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2016-03-10 15:15:02 -0500
committerNicolai Hähnle <[email protected]>2016-03-11 11:53:40 -0500
commit9908b13af61f0cfaae4b750dfc90230314c53b7b (patch)
tree59643f297eb0be85fe1c8ea4cf8b3069bc4d3957 /src/mesa/state_tracker
parent417b6721a007a1e6b425758ffce32fd805d81f16 (diff)
st/mesa: check that the image unit is valid in st_bind_images
Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r--src/mesa/state_tracker/st_atom_image.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mesa/state_tracker/st_atom_image.c b/src/mesa/state_tracker/st_atom_image.c
index d0f0c42a3b3..bf7486b794d 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));