[Mesa-dev] [PATCH] glsl: Fix overflow of ImageAccess[] array.

Timothy Arceri t_arceri at yahoo.com.au
Sun Feb 14 01:43:45 UTC 2016


On Sat, 2016-02-13 at 17:27 -0800, Kenneth Graunke wrote:
> The ImageAccess array is statically sized to MAX_IMAGE_UNIFORMS:
> 
>    GLenum ImageAccess[MAX_IMAGE_UNIFORMS];
> 
> There was no bounds checking ensuring we don't overflow.  Passing in
> a
> shader with too many uniforms would cause writes to extend into other
> fields, such as sh->NumImages.
> 
> Later linker checks already handle reporting an error when there are
> too
> many images, so just avoid corrupting structures here.
> 
> This rearranges the logic a bit to look more like the sampler case.
> 
> Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>


Reviewed-by: Timothy Arceri <timothy.arceri at collabora.com>


More information about the mesa-dev mailing list