summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2014-02-25 07:15:54 -0300
committerMauro Carvalho Chehab <m.chehab@samsung.com>2014-03-11 06:56:45 -0300
commitba38acb1423aa0bc9cd2b38229452b4056911130 (patch)
tree8a7bef8645792906d7d99f728ffbce8d7d639518
parent48d829dadb80a2570aaa99fa324da41b3e05f43b (diff)
downloadop-kernel-dev-ba38acb1423aa0bc9cd2b38229452b4056911130.zip
op-kernel-dev-ba38acb1423aa0bc9cd2b38229452b4056911130.tar.gz
[media] vivi: fix ENUM_FRAMEINTERVALS implementation
This function never checked if width and height are correct. Add such a check so the v4l2-compliance tool returns OK again for vivi. Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <m.chehab@samsung.com>
-rw-r--r--drivers/media/platform/vivi.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/media/platform/vivi.c b/drivers/media/platform/vivi.c
index cfe7548..3890f4f 100644
--- a/drivers/media/platform/vivi.c
+++ b/drivers/media/platform/vivi.c
@@ -1121,7 +1121,11 @@ static int vidioc_enum_frameintervals(struct file *file, void *priv,
if (!fmt)
return -EINVAL;
- /* regarding width & height - we support any */
+ /* check for valid width/height */
+ if (fival->width < 48 || fival->width > MAX_WIDTH || (fival->width & 3))
+ return -EINVAL;
+ if (fival->height < 32 || fival->height > MAX_HEIGHT)
+ return -EINVAL;
fival->type = V4L2_FRMIVAL_TYPE_CONTINUOUS;
OpenPOWER on IntegriCloud