summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Elder <paul.elder@ideasonboard.com>2020-06-18 18:36:17 +0900
committerPaul Elder <paul.elder@ideasonboard.com>2020-06-25 23:47:13 +0900
commit4d150c7faf8291fcd533ab721a0169c3249c26c2 (patch)
tree8c410a0b5d32690bc8e7db57a48eb1163e4a3575
parent609036a9e66f53d4d863efa448b5c4e4ac80f223 (diff)
v4l2: v4l2_camera_proxy: Don't allow streamon if no buffers have been requested
Make VIDIOC_STREAMON return -EINVAL if no buffers have been allocated with reqbufs. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
-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 941237c3..e54df4e6 100644
--- a/src/v4l2/v4l2_camera_proxy.cpp
+++ b/src/v4l2/v4l2_camera_proxy.cpp
@@ -630,6 +630,9 @@ int V4L2CameraProxy::vidioc_streamon(V4L2CameraFile *file, int *arg)
{
LOG(V4L2Compat, Debug) << "Servicing vidioc_streamon fd = " << file->efd();
+ if (bufferCount_ == 0)
+ return -EINVAL;
+
if (!validateBufferType(*arg))
return -EINVAL;