From 82a7c049449ec5a2194249da341ec8bde14e968b Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 28 Jun 2011 10:43:13 -0300 Subject: [PATCH] [media] v4l2-ctrls: make manual_mode_value 8 bits and check against control range Signed-off-by: Hans Verkuil Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/v4l2-ctrls.c | 1 + include/media/v4l2-ctrls.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/media/video/v4l2-ctrls.c b/drivers/media/video/v4l2-ctrls.c index d084cea..1bbaed6 100644 --- a/drivers/media/video/v4l2-ctrls.c +++ b/drivers/media/video/v4l2-ctrls.c @@ -1264,6 +1264,7 @@ void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls, v4l2_ctrl_cluster(ncontrols, controls); WARN_ON(ncontrols <= 1); + WARN_ON(manual_val < master->minimum || manual_val > master->maximum); master->is_auto = true; master->manual_mode_value = manual_val; master->flags |= V4L2_CTRL_FLAG_UPDATE; diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h index de68a59..8f08c6e 100644 --- a/include/media/v4l2-ctrls.h +++ b/include/media/v4l2-ctrls.h @@ -118,7 +118,7 @@ struct v4l2_ctrl { unsigned int is_private:1; unsigned int is_volatile:1; unsigned int is_auto:1; - unsigned int manual_mode_value:5; + unsigned int manual_mode_value:8; const struct v4l2_ctrl_ops *ops; u32 id; -- 2.7.4