summaryrefslogtreecommitdiff
path: root/src/v4l2
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2020-06-18 17:25:36 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2020-06-25 23:47:13 +0900
commitb3dc3d7cf248c2225cd38f6dc54b47d8e012247e (patch)
tree704eb6dc24add7707276d9ed7355745aa7df9f6c /src/v4l2
parentd45d53cde0dce83f221728c8ced859773e64fca7 (diff)
v4l2: v4l2_camera_proxy: Disallow dqbuf when not streaming
Make VIDIOC_DQBUF return -EINVAL if the stream is not turned on. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src/v4l2')
-rw-r--r--src/v4l2/v4l2_camera_proxy.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp
index 0099266e..08fd3fdc 100644
--- a/src/v4l2/v4l2_camera_proxy.cpp
+++ b/src/v4l2/v4l2_camera_proxy.cpp
@@ -580,6 +580,9 @@ int V4L2CameraProxy::vidioc_dqbuf(V4L2CameraFile *file, struct v4l2_buffer *arg)
if (!hasOwnership(file))
return -EBUSY;
+ if (!vcam_->isRunning())
+ return -EINVAL;
+
if (!validateBufferType(arg->type) ||
!validateMemoryType(arg->memory))
return -EINVAL;