From dab064fa5e0b1f5c67222562ad5367005832cba1 Mon Sep 17 00:00:00 2001 From: Andrea Canciani Date: Tue, 2 Nov 2010 20:10:32 +0100 Subject: [PATCH] render: Fix byteswapping of gradient stops 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 Reviewed-by: Soren Sandmann Reviewed-by: Julien Cristau Signed-off-by: Keith Packard --- render/render.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/render/render.c b/render/render.c index 00241f9af..85a43924a 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; } }