diff options
author | Hans Verkuil <hverkuil@xs4all.nl> | 2008-09-06 07:24:37 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@redhat.com> | 2008-10-12 07:36:59 -0400 |
commit | effc3466d32108bec7da19aa23c1fddee9cafbab (patch) | |
tree | bfae96d8ffbe9d249f120a56cbdeb2d54a0a526c /drivers/media/video/cx18/cx18-ioctl.c | |
parent | ff5f26b40ab43a6c263834665bfa10d6114a27cd (diff) |
V4L/DVB (8920): cx18/ivtv: fix check of window boundaries for VIDIOC_S_FMT
It was possible to set out-of-bounds windows sizes, this is now
fixed.
Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/cx18/cx18-ioctl.c')
-rw-r--r-- | drivers/media/video/cx18/cx18-ioctl.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/media/video/cx18/cx18-ioctl.c b/drivers/media/video/cx18/cx18-ioctl.c index 8b26b3fefb1e..4a47f61d9486 100644 --- a/drivers/media/video/cx18/cx18-ioctl.c +++ b/drivers/media/video/cx18/cx18-ioctl.c | |||
@@ -171,7 +171,6 @@ static int cx18_try_fmt_vid_cap(struct file *file, void *fh, | |||
171 | { | 171 | { |
172 | struct cx18_open_id *id = fh; | 172 | struct cx18_open_id *id = fh; |
173 | struct cx18 *cx = id->cx; | 173 | struct cx18 *cx = id->cx; |
174 | |||
175 | int w = fmt->fmt.pix.width; | 174 | int w = fmt->fmt.pix.width; |
176 | int h = fmt->fmt.pix.height; | 175 | int h = fmt->fmt.pix.height; |
177 | 176 | ||
@@ -203,8 +202,7 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh, | |||
203 | struct cx18_open_id *id = fh; | 202 | struct cx18_open_id *id = fh; |
204 | struct cx18 *cx = id->cx; | 203 | struct cx18 *cx = id->cx; |
205 | int ret; | 204 | int ret; |
206 | int w = fmt->fmt.pix.width; | 205 | int w, h; |
207 | int h = fmt->fmt.pix.height; | ||
208 | 206 | ||
209 | ret = v4l2_prio_check(&cx->prio, &id->prio); | 207 | ret = v4l2_prio_check(&cx->prio, &id->prio); |
210 | if (ret) | 208 | if (ret) |
@@ -213,6 +211,8 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh, | |||
213 | ret = cx18_try_fmt_vid_cap(file, fh, fmt); | 211 | ret = cx18_try_fmt_vid_cap(file, fh, fmt); |
214 | if (ret) | 212 | if (ret) |
215 | return ret; | 213 | return ret; |
214 | w = fmt->fmt.pix.width; | ||
215 | h = fmt->fmt.pix.height; | ||
216 | 216 | ||
217 | if (cx->params.width == w && cx->params.height == h) | 217 | if (cx->params.width == w && cx->params.height == h) |
218 | return 0; | 218 | return 0; |