mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-23 08:35:07 +03:00
libcamera: camera: ensure streams belong to camera
Before calling into the pipeline handler make sure the streams provided by the application actually belongs to the camera. Signed-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: Jacopo Mondi <jacopo@jmondi.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
7401f5002e
commit
a3b8083f54
1 changed files with 10 additions and 0 deletions
|
@ -366,6 +366,11 @@ Camera::streamConfiguration(std::set<Stream *> &streams)
|
|||
if (disconnected_ || !streams.size())
|
||||
return std::map<Stream *, StreamConfiguration>{};
|
||||
|
||||
for (Stream *stream : streams) {
|
||||
if (streams_.find(stream) == streams_.end())
|
||||
return std::map<Stream *, StreamConfiguration>{};
|
||||
}
|
||||
|
||||
return pipe_->streamConfiguration(this, streams);
|
||||
}
|
||||
|
||||
|
@ -409,6 +414,11 @@ int Camera::configureStreams(std::map<Stream *, StreamConfiguration> &config)
|
|||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (auto const &iter : config) {
|
||||
if (streams_.find(iter.first) == streams_.end())
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
ret = pipe_->configureStreams(this, config);
|
||||
if (ret)
|
||||
return ret;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue