[Piglit] [PATCH] arb_compute_shader: Fix loop bounds.

Jordan Justen jordan.l.justen at intel.com
Sun Nov 15 16:51:30 PST 2015


Reviewed-by: Jordan Justen <jordan.l.justen at intel.com>

On 2015-11-14 23:29:29, Vinson Lee wrote:
> Fixes "out-of-bounds read" defect reported by Coverity.
> 
> Signed-off-by: Vinson Lee <vlee at freedesktop.org>
> ---
>  tests/spec/arb_compute_shader/cs-ids-common.c | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/tests/spec/arb_compute_shader/cs-ids-common.c b/tests/spec/arb_compute_shader/cs-ids-common.c
> index 0f67f43..e05587f 100644
> --- a/tests/spec/arb_compute_shader/cs-ids-common.c
> +++ b/tests/spec/arb_compute_shader/cs-ids-common.c
> @@ -333,15 +333,15 @@ cs_ids_test_all_sizes()
>         uint32_t x, y, z;
>  
>  
> -       for (zi = 0; zi <= ARRAY_SIZE(sizes); zi++) {
> +       for (zi = 0; zi < ARRAY_SIZE(sizes); zi++) {
>                 z = sizes[zi];
>                 if (z > 64)
>                         break;
> -               for (yi = 0; yi <= ARRAY_SIZE(sizes); yi++) {
> +               for (yi = 0; yi < ARRAY_SIZE(sizes); yi++) {
>                         y = sizes[yi];
>                         if ((y * z) > 1024)
>                                 break;
> -                       for (xi = 0; xi <= ARRAY_SIZE(sizes); xi++) {
> +                       for (xi = 0; xi < ARRAY_SIZE(sizes); xi++) {
>                                 x = sizes[xi];
>                                 if ((x * y * z) > 1024)
>                                         break;
> -- 
> 2.4.9 (Apple Git-60)
> 


More information about the Piglit mailing list