Skip to content

Commit

Permalink
[media] omap3isp: queue: fail QBUF if user buffer is too small
Browse files Browse the repository at this point in the history
Add buffer length check to sanity checks for USERPTR QBUF.

Signed-off-by: Michael Jones <michael.jones@matrix-vision.de>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Michael Jones authored and Mauro Carvalho Chehab committed Sep 11, 2011
1 parent 00542ed commit 61e6561
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions drivers/media/video/omap3isp/ispqueue.c
Original file line number Diff line number Diff line change
Expand Up @@ -867,6 +867,10 @@ int omap3isp_video_queue_qbuf(struct isp_video_queue *queue,
if (buf->state != ISP_BUF_STATE_IDLE)
goto done;

if (vbuf->memory == V4L2_MEMORY_USERPTR &&
vbuf->length < buf->vbuf.length)
goto done;

if (vbuf->memory == V4L2_MEMORY_USERPTR &&
vbuf->m.userptr != buf->vbuf.m.userptr) {
isp_video_buffer_cleanup(buf);
Expand Down

0 comments on commit 61e6561

Please sign in to comment.