summaryrefslogtreecommitdiff
path: root/drivers/media/platform/fsl-viu.c
diff options
context:
space:
mode:
authorHans Verkuil <hans.verkuil@cisco.com>2015-07-20 16:09:32 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-08-11 12:58:41 +0300
commit9acc8093282456f920f7d3e34b0b1b58c3f07dbd (patch)
tree9857efe0d25a73ddf97a8328c72301f5d5dde647 /drivers/media/platform/fsl-viu.c
parent7fe0b3d7c721ddb5a37e868ad27c2476b4042a54 (diff)
downloadlinux-9acc8093282456f920f7d3e34b0b1b58c3f07dbd.tar.xz
[media] fsl-viu: small fixes
- Fix an off-by-one index check in vidioc_enum_fmt() - Fill in the pix.sizeimage field in vidioc_try_fmt_cap() - Fix an off-by-one index check in vidioc_s_input() Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/platform/fsl-viu.c')
-rw-r--r--drivers/media/platform/fsl-viu.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/platform/fsl-viu.c b/drivers/media/platform/fsl-viu.c
index 906442ecd518..69ee2b6c2ffc 100644
--- a/drivers/media/platform/fsl-viu.c
+++ b/drivers/media/platform/fsl-viu.c
@@ -581,7 +581,7 @@ static int vidioc_enum_fmt(struct file *file, void *priv,
{
int index = f->index;
- if (f->index > NUM_FORMATS)
+ if (f->index >= NUM_FORMATS)
return -EINVAL;
strlcpy(f->description, formats[index].name, sizeof(f->description));
@@ -633,6 +633,7 @@ static int vidioc_try_fmt_cap(struct file *file, void *priv,
f->fmt.pix.width &= ~0x03;
f->fmt.pix.bytesperline =
(f->fmt.pix.width * fmt->depth) >> 3;
+ f->fmt.pix.sizeimage = f->fmt.pix.height * f->fmt.pix.bytesperline;
f->fmt.pix.colorspace = V4L2_COLORSPACE_SMPTE170M;
return 0;
@@ -958,7 +959,7 @@ static int vidioc_s_input(struct file *file, void *priv, unsigned int i)
{
struct viu_fh *fh = priv;
- if (i > 1)
+ if (i)
return -EINVAL;
decoder_call(fh->dev, video, s_routing, i, 0, 0);