[PATCH] Stop accessing the attribute array using the attribute name enum.

Robert Ancell robert.ancell at canonical.com
Tue Sep 29 21:02:43 PDT 2015


The array has only two elements but the clamping code was assuming it contained
all the elements in order. This means no clamping is now done but at least it
wont read off the end of the array.

Signed-off-by: Robert Ancell <robert.ancell at canonical.com>
---
 src/smi_video.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/src/smi_video.c b/src/smi_video.c
index 27df68d..a13668e 100644
--- a/src/smi_video.c
+++ b/src/smi_video.c
@@ -681,10 +681,6 @@ SetAttr(ScrnInfoPtr pScrn, int i, int value)
 
     if (i < XV_ENCODING || i > XV_HUE)
 	return BadMatch;
-    
-    /* clamps value to attribute range */
-    value = CLAMP(value, SMI_VideoAttributes[i].min_value,
-		  SMI_VideoAttributes[i].max_value);
 
     if (i == XV_BRIGHTNESS) {
 	int my_value = (value <= 128? value + 128 : value - 128);
-- 
2.5.0



More information about the xorg-devel mailing list