From 09de37ec1c0543c8073f934274c84b3b7d5f31ae Mon Sep 17 00:00:00 2001 From: Junyan He Date: Tue, 15 May 2012 10:07:35 +0800 Subject: [PATCH] Fix a bugy macro definition. The macro like "#define LINEAR_SMALL_STOPS 6 + 2" causes the problem. When use it to define like "GLfloat stop_colors_st[LINEAR_SMALL_STOPS*4];" The array is small than what we supposed it to be. Cause memory corruption problem and cause the bug of render wrong result. Fix it. Signed-off-by: Junyan He Signed-off-by: Zhigang Gong --- glamor/glamor_gradient.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/glamor/glamor_gradient.c b/glamor/glamor_gradient.c index f1c36af69..165d211b9 100644 --- a/glamor/glamor_gradient.c +++ b/glamor/glamor_gradient.c @@ -34,11 +34,11 @@ #ifdef RENDER -#define LINEAR_SMALL_STOPS 6 + 2 -#define LINEAR_LARGE_STOPS 16 + 2 +#define LINEAR_SMALL_STOPS (6 + 2) +#define LINEAR_LARGE_STOPS (16 + 2) -#define RADIAL_SMALL_STOPS 6 + 2 -#define RADIAL_LARGE_STOPS 16 + 2 +#define RADIAL_SMALL_STOPS (6 + 2) +#define RADIAL_LARGE_STOPS (16 + 2) #ifdef GLAMOR_GRADIENT_SHADER