v4l2: v4l2_camera_proxy: Fix bounds check for VIDIOC_ENUM_FMT
VIDIOC_ENUM_FMT is meant to return -EINVAL if the requested index is out of bounds. This bounds is obtained from the libcamera Camera's list of formats. The bounds check for this list was incorrect; fix it. Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>
This commit is contained in:
parent
6e730695de
commit
d072fd6e07
1 changed files with 1 additions and 1 deletions
|
@ -224,7 +224,7 @@ int V4L2CameraProxy::vidioc_enum_fmt(struct v4l2_fmtdesc *arg)
|
||||||
LOG(V4L2Compat, Debug) << "Servicing vidioc_enum_fmt";
|
LOG(V4L2Compat, Debug) << "Servicing vidioc_enum_fmt";
|
||||||
|
|
||||||
if (!validateBufferType(arg->type) ||
|
if (!validateBufferType(arg->type) ||
|
||||||
arg->index > streamConfig_.formats().pixelformats().size())
|
arg->index >= streamConfig_.formats().pixelformats().size())
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
/* \todo Add map from format to description. */
|
/* \todo Add map from format to description. */
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue