[Mesa-dev] [PATCH] mesa/st: only compare the current scissor

Ian Romanick idr at freedesktop.org
Fri Mar 7 05:01:33 PST 2014


On 03/06/2014 05:38 AM, Ilia Mirkin wrote:
> sizeof(scissor) returns the size of the full array rather than a single
> element. Fix it to consider just the one element.
> 
> Fixes: 0705fa35cdaf15ec969c28dc85e88b8be1149a3b
> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu>

Yeah, this looks right.

Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

Of course, you may want to also wait for someone who knows Gallium to
review...

> ---
> 
> Noticed this when playing with valgrind for unrelated reasons. Seems fairly
> obvious.
> 
>  src/mesa/state_tracker/st_atom_scissor.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/src/mesa/state_tracker/st_atom_scissor.c b/src/mesa/state_tracker/st_atom_scissor.c
> index a19ade1..b720309 100644
> --- a/src/mesa/state_tracker/st_atom_scissor.c
> +++ b/src/mesa/state_tracker/st_atom_scissor.c
> @@ -85,7 +85,7 @@ update_scissor( struct st_context *st )
>           scissor[i].maxy = maxy;
>        }
>  
> -      if (memcmp(&scissor[i], &st->state.scissor[i], sizeof(scissor)) != 0) {
> +      if (memcmp(&scissor[i], &st->state.scissor[i], sizeof(scissor[0])) != 0) {
>           /* state has changed */
>           st->state.scissor[i] = scissor[i];  /* struct copy */
>           changed = true;
> 



More information about the mesa-dev mailing list