summaryrefslogtreecommitdiff
path: root/linux/drivers/media/video/cx18/cx18-ioctl.c
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-09-06 13:24:37 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2008-09-06 13:24:37 +0200
commit0511b536a45b03ed2c7a01e57d8a47bfe64dbf01 (patch)
tree48440ca149aeb388d3098b6783a112effc8cddd9 /linux/drivers/media/video/cx18/cx18-ioctl.c
parentb0df217c327d6f4e26f14949febcec389906e27b (diff)
downloadmediapointer-dvb-s2-0511b536a45b03ed2c7a01e57d8a47bfe64dbf01.tar.gz
mediapointer-dvb-s2-0511b536a45b03ed2c7a01e57d8a47bfe64dbf01.tar.bz2
cx18/ivtv: fix check of window boundaries for VIDIOC_S_FMT
From: Hans Verkuil <hverkuil@xs4all.nl> It was possible to set out-of-bounds windows sizes, this is now fixed. Priority: normal Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
Diffstat (limited to 'linux/drivers/media/video/cx18/cx18-ioctl.c')
-rw-r--r--linux/drivers/media/video/cx18/cx18-ioctl.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/linux/drivers/media/video/cx18/cx18-ioctl.c b/linux/drivers/media/video/cx18/cx18-ioctl.c
index 1ef2690d4..b909c78d3 100644
--- a/linux/drivers/media/video/cx18/cx18-ioctl.c
+++ b/linux/drivers/media/video/cx18/cx18-ioctl.c
@@ -201,7 +201,6 @@ static int cx18_try_fmt_vid_cap(struct file *file, void *fh,
{
struct cx18_open_id *id = fh;
struct cx18 *cx = id->cx;
-
int w = fmt->fmt.pix.width;
int h = fmt->fmt.pix.height;
@@ -249,8 +248,7 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
struct cx18_open_id *id = fh;
struct cx18 *cx = id->cx;
int ret;
- int w = fmt->fmt.pix.width;
- int h = fmt->fmt.pix.height;
+ int w, h;
ret = v4l2_prio_check(&cx->prio, &id->prio);
if (ret)
@@ -259,6 +257,8 @@ static int cx18_s_fmt_vid_cap(struct file *file, void *fh,
ret = cx18_try_fmt_vid_cap(file, fh, fmt);
if (ret)
return ret;
+ w = fmt->fmt.pix.width;
+ h = fmt->fmt.pix.height;
if (cx->params.width == w && cx->params.height == h)
return 0;