diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2021-09-27 00:05:54 +0300 |
---|---|---|
committer | Kieran Bingham <kieran.bingham@ideasonboard.com> | 2021-09-28 11:53:00 +0100 |
commit | 6cb63c923c49a8763ec99eb7a9285ef79558b8f2 (patch) | |
tree | d4467fc8805b3d3f66cd1342bd4dc56e08906b36 /meson.build | |
parent | 1f795410c0d99aaa15c8155d7d16ae6357487a96 (diff) |
simple-cam: Move camera detection check to where it belongs
Commit 14529b6d1c4a ("simple-cam: Early return if no cameras are found
on the system") added a check to ensure that at least one camera is
present in the system to avoid a crash otherwise. The check was however
placed towards the end of the main() function, way after the camera is
accessed, possibly due to a rebase conflict. Move it before accessing
the first camera.
While at it, replace usage of std::vector::size() with
std::vector::empty() which expresses the intent better.
Fixes: 14529b6d1c4a ("simple-cam: Early return if no cameras are found on the system")
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Paul Elder <paul.elder@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
Diffstat (limited to 'meson.build')
0 files changed, 0 insertions, 0 deletions