android: camera_device: Fix variables access without protection
This fixes the code accessing descriptors and Camera3RequestDescriptor::pendingStreamsToProcess_ without holding descriptorsMutex_ and Camera3RequestDescriptor::streamProcessMutex_ in CameraDevice. Signed-off-by: Hirokazu Honda <hiroh@chromium.org> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
This commit is contained in:
parent
97ab0074ec
commit
f6807016a3
1 changed files with 8 additions and 1 deletions
|
@ -436,7 +436,11 @@ void CameraDevice::stop()
|
||||||
worker_.stop();
|
worker_.stop();
|
||||||
camera_->stop();
|
camera_->stop();
|
||||||
|
|
||||||
|
{
|
||||||
|
MutexLocker descriptorsLock(descriptorsMutex_);
|
||||||
descriptors_ = {};
|
descriptors_ = {};
|
||||||
|
}
|
||||||
|
|
||||||
streams_.clear();
|
streams_.clear();
|
||||||
|
|
||||||
state_ = State::Stopped;
|
state_ = State::Stopped;
|
||||||
|
@ -933,6 +937,9 @@ int CameraDevice::processCaptureRequest(camera3_capture_request_t *camera3Reques
|
||||||
*/
|
*/
|
||||||
FrameBuffer *frameBuffer = nullptr;
|
FrameBuffer *frameBuffer = nullptr;
|
||||||
int acquireFence = -1;
|
int acquireFence = -1;
|
||||||
|
|
||||||
|
MutexLocker lock(descriptor->streamsProcessMutex_);
|
||||||
|
|
||||||
switch (cameraStream->type()) {
|
switch (cameraStream->type()) {
|
||||||
case CameraStream::Type::Mapped:
|
case CameraStream::Type::Mapped:
|
||||||
/*
|
/*
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue