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>
This commit is contained in:
Paul Elder 2020-06-18 18:36:17 +09:00
parent 609036a9e6
commit 4d150c7faf

View file

@ -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;