Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138029
b: refs/heads/master
c: 9cfb6a3
h: refs/heads/master
i:
  138027: 901f13b
v: v3
  • Loading branch information
Trent Piepho authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent 8adb741 commit 52cccac
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 21 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: 86b5aeacabb4451655c528c41d45ca05b753f72c
refs/heads/master: 9cfb6a3f1b16e82fab97831265858aa2d1983883
4 changes: 0 additions & 4 deletions trunk/drivers/media/video/meye.c
Original file line number Diff line number Diff line change
Expand Up @@ -1446,10 +1446,6 @@ static int vidioc_querybuf(struct file *file, void *fh, struct v4l2_buffer *buf)
if (index < 0 || index >= gbuffers)
return -EINVAL;

memset(buf, 0, sizeof(*buf));

buf->type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf->index = index;
buf->bytesused = meye.grab_buffer[index].size;
buf->flags = V4L2_BUF_FLAG_MAPPED;

Expand Down
8 changes: 1 addition & 7 deletions trunk/drivers/media/video/stk-webcam.c
Original file line number Diff line number Diff line change
Expand Up @@ -1139,16 +1139,10 @@ static int stk_vidioc_reqbufs(struct file *filp,
static int stk_vidioc_querybuf(struct file *filp,
void *priv, struct v4l2_buffer *buf)
{
int index;
struct stk_camera *dev = priv;
struct stk_sio_buffer *sbuf;

if (buf->type != V4L2_BUF_TYPE_VIDEO_CAPTURE)
return -EINVAL;

index = buf->index;

if (index < 0 || index >= dev->n_sbufs)
if (buf->index < 0 || buf->index >= dev->n_sbufs)
return -EINVAL;
sbuf = dev->sio_bufs + buf->index;
*buf = sbuf->v4lbuf;
Expand Down
3 changes: 0 additions & 3 deletions trunk/drivers/media/video/usbvision/usbvision-video.c
Original file line number Diff line number Diff line change
Expand Up @@ -788,9 +788,6 @@ static int vidioc_querybuf (struct file *file,

/* FIXME : must control
that buffers are mapped (VIDIOC_REQBUFS has been called) */
if(vb->type != V4L2_CAP_VIDEO_CAPTURE) {
return -EINVAL;
}
if(vb->index>=usbvision->num_frames) {
return -EINVAL;
}
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/media/video/v4l2-ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,11 @@ static long __video_do_ioctl(struct file *file,
if (ret)
break;

/* Zero out all fields starting with bytesysed, which is
* everything but index and type. */
memset(0, &p->bytesused,
sizeof(*p) - offsetof(typeof(*p), bytesused));

ret = ops->vidioc_querybuf(file, fh, p);
if (!ret)
dbgbuf(cmd, vfd, p);
Expand Down
7 changes: 1 addition & 6 deletions trunk/drivers/media/video/zoran/zoran_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -2498,12 +2498,7 @@ static int zoran_querybuf(struct file *file, void *__fh, struct v4l2_buffer *buf
{
struct zoran_fh *fh = __fh;
struct zoran *zr = fh->zr;
__u32 type = buf->type;
int index = buf->index, res;

memset(buf, 0, sizeof(*buf));
buf->type = type;
buf->index = index;
int res;

mutex_lock(&zr->resource_lock);
res = zoran_v4l2_buffer_status(file, buf, buf->index);
Expand Down

0 comments on commit 52cccac

Please sign in to comment.