[vlc-devel] [PATCH] V4L2 controls should allow negative values

Brian Johnson brijohn at gmail.com
Fri Mar 20 20:05:01 CET 2009


This changes range validation for control values from
value >= 0 to value >= minimum && value <= maximum

Signed-off-by: Brian Johnson <brijohn at gmail.com>
---
 modules/access/v4l2.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/modules/access/v4l2.c b/modules/access/v4l2.c
index f1f4990..38abc61 100644
--- a/modules/access/v4l2.c
+++ b/modules/access/v4l2.c
@@ -2932,7 +2932,7 @@ static int Control( vlc_object_t *p_obj, int i_fd,
 
     int i_ret = -1;
 
-    if( i_value >= 0 )
+    if( i_value >= queryctrl.minimum && i_value <= queryctrl.maximum )
     {
         ext_control.value = i_value;
         if( v4l2_ioctl( i_fd, VIDIOC_S_EXT_CTRLS, &ext_controls ) < 0 )
-- 
1.5.6.3




More information about the vlc-devel mailing list