[media] omap3isp: queue: fail QBUF if user buffer is too small
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>
This commit is contained in:
parent
00542edf07
commit
61e6561fae
1 changed files with 4 additions and 0 deletions
|
@ -867,6 +867,10 @@ int omap3isp_video_queue_qbuf(struct isp_video_queue *queue,
|
||||||
if (buf->state != ISP_BUF_STATE_IDLE)
|
if (buf->state != ISP_BUF_STATE_IDLE)
|
||||||
goto done;
|
goto done;
|
||||||
|
|
||||||
|
if (vbuf->memory == V4L2_MEMORY_USERPTR &&
|
||||||
|
vbuf->length < buf->vbuf.length)
|
||||||
|
goto done;
|
||||||
|
|
||||||
if (vbuf->memory == V4L2_MEMORY_USERPTR &&
|
if (vbuf->memory == V4L2_MEMORY_USERPTR &&
|
||||||
vbuf->m.userptr != buf->vbuf.m.userptr) {
|
vbuf->m.userptr != buf->vbuf.m.userptr) {
|
||||||
isp_video_buffer_cleanup(buf);
|
isp_video_buffer_cleanup(buf);
|
||||||
|
|
Loading…
Reference in a new issue