[Glamor] [PATCH 2/7] Fix bug of memory corruption.

Zhigang Gong zhigang.gong at linux.intel.com
Mon May 14 21:32:54 PDT 2012


On Tue, May 08, 2012 at 08:44:35AM +0800, junyan.he at linux.intel.com wrote:
> From: Junyan He <junyan.he at linux.intel.com>
> 
>  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 <junyan.he at linux.intel.com>
> ---
>  src/glamor_gradient.c |    8 ++++----
>  1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/src/glamor_gradient.c b/src/glamor_gradient.c
> index cc8b447..234aa9e 100644
> --- a/src/glamor_gradient.c
> +++ b/src/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
>  

Reviewed-by: Zhigang Gong <zhigang.gong at linux.intel.com>
> -- 
> 1.7.7.6
> 


More information about the Glamor mailing list