Skip to content

Commit

Permalink
V4L/DVB (10408): v4l2: fix incorrect hue range check
Browse files Browse the repository at this point in the history
A hue of -128 was rejected due to an incorrect range check, which was
faithfully copy-and-pasted into four drivers...

Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent d9ddd3b commit de6476f
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion drivers/media/video/cx18/cx18-av-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,7 @@ static int set_v4lctrl(struct cx18 *cx, struct v4l2_control *ctrl)
break;

case V4L2_CID_HUE:
if (ctrl->value < -127 || ctrl->value > 127) {
if (ctrl->value < -128 || ctrl->value > 127) {
CX18_ERR("invalid hue setting %d\n", ctrl->value);
return -ERANGE;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/cx25840/cx25840-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ static int cx25840_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
break;

case V4L2_CID_HUE:
if (ctrl->value < -127 || ctrl->value > 127) {
if (ctrl->value < -128 || ctrl->value > 127) {
v4l_err(client, "invalid hue setting %d\n", ctrl->value);
return -ERANGE;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/saa7115.c
Original file line number Diff line number Diff line change
Expand Up @@ -778,7 +778,7 @@ static int saa711x_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
break;

case V4L2_CID_HUE:
if (ctrl->value < -127 || ctrl->value > 127) {
if (ctrl->value < -128 || ctrl->value > 127) {
v4l2_err(sd, "invalid hue setting %d\n", ctrl->value);
return -ERANGE;
}
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/video/saa717x.c
Original file line number Diff line number Diff line change
Expand Up @@ -931,7 +931,7 @@ static int saa717x_s_ctrl(struct v4l2_subdev *sd, struct v4l2_control *ctrl)
break;

case V4L2_CID_HUE:
if (ctrl->value < -127 || ctrl->value > 127) {
if (ctrl->value < -128 || ctrl->value > 127) {
v4l2_err(sd, "invalid hue setting %d\n", ctrl->value);
return -ERANGE;
}
Expand Down

0 comments on commit de6476f

Please sign in to comment.