Commit 61e6561f authored by Michael Jones's avatar Michael Jones Committed by Mauro Carvalho Chehab

[media] omap3isp: queue: fail QBUF if user buffer is too small

Add buffer length check to sanity checks for USERPTR QBUF.
Signed-off-by: default avatarMichael Jones <michael.jones@matrix-vision.de>
Acked-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent 00542edf
......@@ -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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment