V4L/DVB (10272): av7110: test type field in VIDIOC_G_SLICED_VBI_CAP
authorHans Verkuil <hverkuil@xs4all.nl>
Mon, 19 Jan 2009 07:14:17 +0000 (04:14 -0300)
committerMauro Carvalho Chehab <mchehab@redhat.com>
Mon, 30 Mar 2009 15:42:24 +0000 (12:42 -0300)
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
drivers/media/dvb/ttpci/av7110_v4l.c

index 04334058f8f84137bc4bb596e09308f518a78507..2210cff738e67a7e47a26d29faddb18633ba0ee1 100644 (file)
@@ -519,7 +519,8 @@ static int vidioc_g_sliced_vbi_cap(struct file *file, void *fh,
        struct av7110 *av7110 = (struct av7110 *)dev->ext_priv;
 
        dprintk(2, "VIDIOC_G_SLICED_VBI_CAP\n");
-       memset(cap, 0, sizeof(*cap));
+       if (cap->type != V4L2_BUF_TYPE_SLICED_VBI_OUTPUT)
+               return -EINVAL;
        if (FW_VERSION(av7110->arm_app) >= 0x2623) {
                cap->service_set = V4L2_SLICED_WSS_625;
                cap->service_lines[0][23] = V4L2_SLICED_WSS_625;