[PATCH 2/2] render: Fix byteswapping of gradient stops

Julien Cristau jcristau at debian.org
Wed Dec 1 14:59:04 PST 2010


On Thu, Nov  4, 2010 at 02:44:48 +0100, Soeren Sandmann wrote:

> Andrea Canciani <ranma42 at gmail.com> writes:
> 
> > The function swapStops repeatedly swaps the color components as
> > CARD16, but incorrectly steps over them as if they were CARD32.
> > 
> > This causes half of the stops not to be swapped at all and some
> > unrelated data be swapped instead.
> > ---
> >  render/render.c |    4 ++--
> >  1 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/render/render.c b/render/render.c
> > index 00241f9..85a4392 100644
> > --- a/render/render.c
> > +++ b/render/render.c
> > @@ -2552,8 +2552,8 @@ static void swapStops(void *stuff, int num)
> >      }
> >      colors = (CARD16 *)(stops);
> >      for (i = 0; i < 4*num; ++i) {
> > -        swaps(stops, n);
> > -        ++stops;
> > +        swaps(colors, n);
> > +        ++colors;
> >      }
> >  }
> 
> Reviewed-by: Soren Sandmann <sandmann at daimi.au.dk>
> 
Reviewed-by: Julien Cristau <jcristau at debian.org>

Keith, can you take this one?  It would be nice to have it on the stable
branches.

Cheers,
Julien


More information about the xorg-devel mailing list