[libcamera-devel] [PATCH v3 19/22] v4l2: v4l2_camera_proxy: Don't allow streamon if no buffers have been requested

Paul Elder paul.elder at ideasonboard.com
Tue Jun 23 21:08:33 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 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 0e87631..dd09951 100644
--- a/src/v4l2/v4l2_camera_proxy.cpp
+++ b/src/v4l2/v4l2_camera_proxy.cpp
@@ -636,6 +636,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