From 23ff6043add670713bbf2f6ee5d520459cfdfae9 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Thu, 4 Jun 2009 09:26:39 -0300 Subject: V4L/DVB (11945): uvcvideo: Don't accept to change the format when buffers are allocated. Setting a new frame format or size will likely change the buffer size required to store a complete video frame. To avoid a buffer overflow, don't allow VIDIOC_S_FMT calls when video buffers are already allocated. Signed-off-by: Laurent Pinchart Signed-off-by: Mauro Carvalho Chehab --- drivers/media/video/uvc/uvcvideo.h | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/media/video/uvc/uvcvideo.h') diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h index f435e8eeccd..3c78d3c1e4c 100644 --- a/drivers/media/video/uvc/uvcvideo.h +++ b/drivers/media/video/uvc/uvcvideo.h @@ -747,6 +747,7 @@ extern struct uvc_buffer *uvc_queue_next_buffer(struct uvc_video_queue *queue, struct uvc_buffer *buf); extern unsigned int uvc_queue_poll(struct uvc_video_queue *queue, struct file *file, poll_table *wait); +extern int uvc_queue_allocated(struct uvc_video_queue *queue); static inline int uvc_queue_streaming(struct uvc_video_queue *queue) { return queue->flags & UVC_QUEUE_STREAMING; -- cgit v1.2.3-70-g09d2