Commit eac9aa00 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

[media] v4l: Fix a use-before-set in the control framework

v4l2_queryctrl sets the step value based on the control type. That would
be fine if it used the control type stored in the V4L2 kernel control
object, not the one stored in the userspace ioctl structure that has
just been memset to 0. Fix this.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: default avatarHans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 01c40c04
...@@ -1352,7 +1352,7 @@ int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc) ...@@ -1352,7 +1352,7 @@ int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc)
qc->minimum = ctrl->minimum; qc->minimum = ctrl->minimum;
qc->maximum = ctrl->maximum; qc->maximum = ctrl->maximum;
qc->default_value = ctrl->default_value; qc->default_value = ctrl->default_value;
if (qc->type == V4L2_CTRL_TYPE_MENU) if (ctrl->type == V4L2_CTRL_TYPE_MENU)
qc->step = 1; qc->step = 1;
else else
qc->step = ctrl->step; qc->step = ctrl->step;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment