diff options
Diffstat (limited to 'drivers/media/video/v4l1-compat.c')
| -rw-r--r-- | drivers/media/video/v4l1-compat.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/media/video/v4l1-compat.c b/drivers/media/video/v4l1-compat.c index 4134549d11a8..2ab5b4093800 100644 --- a/drivers/media/video/v4l1-compat.c +++ b/drivers/media/video/v4l1-compat.c | |||
| @@ -951,6 +951,10 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
| 951 | dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err); | 951 | dprintk("VIDIOCGVBIFMT / VIDIOC_G_FMT: %d\n", err); |
| 952 | break; | 952 | break; |
| 953 | } | 953 | } |
| 954 | if (fmt2->fmt.vbi.sample_format != V4L2_PIX_FMT_GREY) { | ||
| 955 | err = -EINVAL; | ||
| 956 | break; | ||
| 957 | } | ||
| 954 | memset(fmt, 0, sizeof(*fmt)); | 958 | memset(fmt, 0, sizeof(*fmt)); |
| 955 | fmt->samples_per_line = fmt2->fmt.vbi.samples_per_line; | 959 | fmt->samples_per_line = fmt2->fmt.vbi.samples_per_line; |
| 956 | fmt->sampling_rate = fmt2->fmt.vbi.sampling_rate; | 960 | fmt->sampling_rate = fmt2->fmt.vbi.sampling_rate; |
| @@ -966,6 +970,11 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
| 966 | { | 970 | { |
| 967 | struct vbi_format *fmt = arg; | 971 | struct vbi_format *fmt = arg; |
| 968 | 972 | ||
| 973 | if (VIDEO_PALETTE_RAW != fmt->sample_format) { | ||
| 974 | err = -EINVAL; | ||
| 975 | break; | ||
| 976 | } | ||
| 977 | |||
| 969 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); | 978 | fmt2 = kmalloc(sizeof(*fmt2),GFP_KERNEL); |
| 970 | memset(fmt2, 0, sizeof(*fmt2)); | 979 | memset(fmt2, 0, sizeof(*fmt2)); |
| 971 | 980 | ||
| @@ -986,7 +995,7 @@ v4l_compat_translate_ioctl(struct inode *inode, | |||
| 986 | 995 | ||
| 987 | if (fmt2->fmt.vbi.samples_per_line != fmt->samples_per_line || | 996 | if (fmt2->fmt.vbi.samples_per_line != fmt->samples_per_line || |
| 988 | fmt2->fmt.vbi.sampling_rate != fmt->sampling_rate || | 997 | fmt2->fmt.vbi.sampling_rate != fmt->sampling_rate || |
| 989 | VIDEO_PALETTE_RAW != fmt->sample_format || | 998 | fmt2->fmt.vbi.sample_format != V4L2_PIX_FMT_GREY || |
| 990 | fmt2->fmt.vbi.start[0] != fmt->start[0] || | 999 | fmt2->fmt.vbi.start[0] != fmt->start[0] || |
| 991 | fmt2->fmt.vbi.count[0] != fmt->count[0] || | 1000 | fmt2->fmt.vbi.count[0] != fmt->count[0] || |
| 992 | fmt2->fmt.vbi.start[1] != fmt->start[1] || | 1001 | fmt2->fmt.vbi.start[1] != fmt->start[1] || |
