summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHirokazu Honda <hiroh@chromium.org>2021-04-03 22:18:28 +0900
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2021-04-04 01:38:21 +0300
commitd13462f3d0f31cd24f11f44c1efe09457c691aba (patch)
tree3676afb934c3a6aab3a6f8a0a5f8a11c6f2067a9 /src
parent7d7879833812635f3d34a8b41b93202b4faf4f9c (diff)
android: CameraDevice: Deny if the streams is empty
This checks if the number of streams is zero on configuration and then returns -EINVAL. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'src')
-rw-r--r--src/android/camera_device.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/android/camera_device.cpp b/src/android/camera_device.cpp
index eb327978..0e942390 100644
--- a/src/android/camera_device.cpp
+++ b/src/android/camera_device.cpp
@@ -1554,6 +1554,11 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
running_ = false;
}
+ if (stream_list->num_streams == 0) {
+ LOG(HAL, Error) << "No streams in configuration";
+ return -EINVAL;
+ }
+
/*
* Generate an empty configuration, and construct a StreamConfiguration
* for each camera3_stream to add to it.