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

junyan.he at linux.intel.com junyan.he at linux.intel.com
Mon May 14 19:07:35 PDT 2012


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 f6b635f..5892d64 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
 
-- 
1.7.7.6



More information about the Glamor mailing list