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:
Hirokazu Honda 2021-04-03 22:18:28 +09:00 committed by Laurent Pinchart
parent 7d78798338
commit d13462f3d0

View file

@ -1554,6 +1554,11 @@ int CameraDevice::configureStreams(camera3_stream_configuration_t *stream_list)
running_ = false; 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 * Generate an empty configuration, and construct a StreamConfiguration
* for each camera3_stream to add to it. * for each camera3_stream to add to it.