[libcamera-devel] [PATCH v4 19/22] v4l2: v4l2_camera_proxy: Don't allow streamon if no buffers have been requested
Paul Elder
paul.elder at ideasonboard.com
Wed Jun 24 16:52:53 CEST 2020
Make VIDIOC_STREAMON return -EINVAL if no buffers have been allocated
with reqbufs.
Signed-off-by: Paul Elder <paul.elder at ideasonboard.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
---
No change in v4
No change in v3
New in v2
- split from "Fix v4l2-compliance streaming tests"
---
src/v4l2/v4l2_camera_proxy.cpp | 3 +++
1 file changed, 3 insertions(+)
diff --git a/src/v4l2/v4l2_camera_proxy.cpp b/src/v4l2/v4l2_camera_proxy.cpp
index 2aff53e..2dbeef3 100644
--- a/src/v4l2/v4l2_camera_proxy.cpp
+++ b/src/v4l2/v4l2_camera_proxy.cpp
@@ -632,6 +632,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;
--
2.27.0
More information about the libcamera-devel
mailing list