Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 254640
b: refs/heads/master
c: 383e4f6
h: refs/heads/master
v: v3
  • Loading branch information
Vaibhav Hiremath authored and Mauro Carvalho Chehab committed Jul 1, 2011
1 parent 729f288 commit b3a0ebd
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 8f3a307b9afd8c2ebde46ef317df4df3813301a7
refs/heads/master: 383e4f69879d11c86ebdd38b3356f6d0690fb4cc
16 changes: 16 additions & 0 deletions trunk/drivers/media/video/omap/omap_vout.c
Original file line number Diff line number Diff line change
Expand Up @@ -982,6 +982,14 @@ static int omap_vout_buffer_setup(struct videobuf_queue *q, unsigned int *count,
startindex = (vout->vid == OMAP_VIDEO1) ?
video1_numbuffers : video2_numbuffers;

/* Check the size of the buffer */
if (*size > vout->buffer_size) {
v4l2_err(&vout->vid_dev->v4l2_dev,
"buffer allocation mismatch [%u] [%u]\n",
*size, vout->buffer_size);
return -ENOMEM;
}

for (i = startindex; i < *count; i++) {
vout->buffer_size = *size;

Expand Down Expand Up @@ -1228,6 +1236,14 @@ static int omap_vout_mmap(struct file *file, struct vm_area_struct *vma)
(vma->vm_pgoff << PAGE_SHIFT));
return -EINVAL;
}
/* Check the size of the buffer */
if (size > vout->buffer_size) {
v4l2_err(&vout->vid_dev->v4l2_dev,
"insufficient memory [%lu] [%u]\n",
size, vout->buffer_size);
return -ENOMEM;
}

q->bufs[i]->baddr = vma->vm_start;

vma->vm_flags |= VM_RESERVED;
Expand Down

0 comments on commit b3a0ebd

Please sign in to comment.