diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2015-03-06 07:54:47 -0500 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@osg.samsung.com> | 2015-04-02 16:31:48 -0400 |
commit | 1cdf60c97a9e7bc1829cca2e52d61be75f02c13c (patch) | |
tree | 2b1a67b0a1eb5bbe94e05492e77bd889572ce3d5 | |
parent | fe6524719d67623786f1a993421388d3b373ab9d (diff) |
[media] uvcvideo: Validate index during step-wise frame intervals enumeration
Frame intervals exposed as an interval and step (so-called step-wise)
are restricted by the V4L2 API to a single enumeration entry. Return an
error when the index is not zero.
Reported-by: Alexey Smirnoff <fling@member.fsf.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
[mchehab@osg.samsung.com: add a missing collon at the end of the return
statement, in order to avoid compilation breakage]
Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
-rw-r--r-- | drivers/media/usb/uvc/uvc_v4l2.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/media/usb/uvc/uvc_v4l2.c b/drivers/media/usb/uvc/uvc_v4l2.c index 43e953f73e02..8d967fe2ef7d 100644 --- a/drivers/media/usb/uvc/uvc_v4l2.c +++ b/drivers/media/usb/uvc/uvc_v4l2.c | |||
@@ -1133,6 +1133,9 @@ static int uvc_ioctl_enum_frameintervals(struct file *file, void *fh, | |||
1133 | uvc_simplify_fraction(&fival->discrete.numerator, | 1133 | uvc_simplify_fraction(&fival->discrete.numerator, |
1134 | &fival->discrete.denominator, 8, 333); | 1134 | &fival->discrete.denominator, 8, 333); |
1135 | } else { | 1135 | } else { |
1136 | if (fival->index) | ||
1137 | return -EINVAL; | ||
1138 | |||
1136 | fival->type = V4L2_FRMIVAL_TYPE_STEPWISE; | 1139 | fival->type = V4L2_FRMIVAL_TYPE_STEPWISE; |
1137 | fival->stepwise.min.numerator = frame->dwFrameInterval[0]; | 1140 | fival->stepwise.min.numerator = frame->dwFrameInterval[0]; |
1138 | fival->stepwise.min.denominator = 10000000; | 1141 | fival->stepwise.min.denominator = 10000000; |