Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 306166
b: refs/heads/master
c: 32898a1
h: refs/heads/master
v: v3
  • Loading branch information
Xi Wang authored and Mauro Carvalho Chehab committed Apr 19, 2012
1 parent 36f1b6f commit 277f71a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3fc82fa001cac8f22e7493a02c795f2bb33cafac
refs/heads/master: 32898a145404acbebe3256709e012c2830a2043b
20 changes: 17 additions & 3 deletions trunk/drivers/media/video/zoran/zoran_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -1131,8 +1131,14 @@ static int setup_fbuffer(struct zoran_fh *fh,
}


static int setup_window(struct zoran_fh *fh, int x, int y, int width, int height,
struct v4l2_clip __user *clips, int clipcount, void __user *bitmap)
static int setup_window(struct zoran_fh *fh,
int x,
int y,
int width,
int height,
struct v4l2_clip __user *clips,
unsigned int clipcount,
void __user *bitmap)
{
struct zoran *zr = fh->zr;
struct v4l2_clip *vcp = NULL;
Expand All @@ -1155,6 +1161,14 @@ static int setup_window(struct zoran_fh *fh, int x, int y, int width, int height
return -EINVAL;
}

if (clipcount > 2048) {
dprintk(1,
KERN_ERR
"%s: %s - invalid clipcount\n",
ZR_DEVNAME(zr), __func__);
return -EINVAL;
}

/*
* The video front end needs 4-byte alinged line sizes, we correct that
* silently here if necessary
Expand Down Expand Up @@ -1218,7 +1232,7 @@ static int setup_window(struct zoran_fh *fh, int x, int y, int width, int height
(width * height + 7) / 8)) {
return -EFAULT;
}
} else if (clipcount > 0) {
} else if (clipcount) {
/* write our own bitmap from the clips */
vcp = vmalloc(sizeof(struct v4l2_clip) * (clipcount + 4));
if (vcp == NULL) {
Expand Down

0 comments on commit 277f71a

Please sign in to comment.