From 96fc40e67f6a78898bc6b59eaa0104bfe8a79f1d Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Tue, 25 Feb 2014 07:15:54 -0300 Subject: [PATCH] upstream: [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 Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/vivi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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; -- 2.7.4