Skip to content

Commit

Permalink
render: Fix byteswapping of gradient stops
Browse files Browse the repository at this point in the history
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.

Signed-off-by: Andrea Canciani <ranma42@gmail.com>
Reviewed-by: Soren Sandmann <sandmann@daimi.au.dk>
Reviewed-by: Julien Cristau <jcristau@debian.org>
Signed-off-by: Keith Packard <keithp@keithp.com>
  • Loading branch information
ranma42 authored and keith-packard committed Dec 2, 2010
1 parent 279ef1f commit dab064f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions render/render.c
Expand Up @@ -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;
}
}

Expand Down

0 comments on commit dab064f

Please sign in to comment.