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>
This commit is contained in:
committed by
Laurent Pinchart
parent
7d78798338
commit
d13462f3d0
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user