diff options
author | Paul Elder <paul.elder@ideasonboard.com> | 2020-06-18 18:36:17 +0900 |
---|---|---|
committer | Paul Elder <paul.elder@ideasonboard.com> | 2020-06-25 23:47:13 +0900 |
commit | 4d150c7faf8291fcd533ab721a0169c3249c26c2 (patch) | |
tree | 8c410a0b5d32690bc8e7db57a48eb1163e4a3575 /src/v4l2 | |
parent | 609036a9e66f53d4d863efa448b5c4e4ac80f223 (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>
Diffstat (limited to 'src/v4l2')
-rw-r--r-- | src/v4l2/v4l2_camera_proxy.cpp | 3 |
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; |