summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorZhijun He <zhijunhe@google.com>2013-06-05 20:00:09 -0700
committerZhijun He <zhijunhe@google.com>2013-06-06 10:42:40 -0700
commit62a8f67f33faf19d0ff815672dd19bb71dd0d650 (patch)
tree3a88fd9b3cc9e795e60c8c37117db55f5ad39bef /services
parent254446a80cb13d5beb606bfc3e60a17473869478 (diff)
downloadframeworks_av-62a8f67f33faf19d0ff815672dd19bb71dd0d650.zip
frameworks_av-62a8f67f33faf19d0ff815672dd19bb71dd0d650.tar.gz
frameworks_av-62a8f67f33faf19d0ff815672dd19bb71dd0d650.tar.bz2
camera2/3: Add protection to callback processing call
Callback stream in callbackprocessor could be delleted while process or discard callback are ongoing, which leads CpuConsumer related call crash. Bug 9303911 Change-Id: Ib6137e512208e5603468eba166640729b744e8f9
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/camera2/CallbackProcessor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/camera2/CallbackProcessor.cpp b/services/camera/libcameraservice/camera2/CallbackProcessor.cpp
index 5fa84e0..05c0abe 100644
--- a/services/camera/libcameraservice/camera2/CallbackProcessor.cpp
+++ b/services/camera/libcameraservice/camera2/CallbackProcessor.cpp
@@ -182,6 +182,13 @@ bool CallbackProcessor::threadLoop() {
}
do {
+ Mutex::Autolock l(mInputMutex);
+ if (mCallbackStreamId == NO_STREAM) {
+ ALOGV("%s: Camera %d:No stream is available"
+ , __FUNCTION__, mId);
+ break;
+ }
+
sp<Camera2Client> client = mClient.promote();
if (client == 0) {
res = discardNewCallback();