summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorIgor Murashkin <iam@google.com>2014-03-18 00:20:54 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2014-03-18 00:20:54 +0000
commit557847ee511dd5e75d584ff04449322f0f098241 (patch)
treebae95f72a0c78169db8fd138f82629e73400bac3 /services
parent9a9481f89b26211b20d7f3fde3d54b455843bf70 (diff)
parenta6ca0acf0d009acf45b05561273aaad44ab22533 (diff)
downloadframeworks_av-557847ee511dd5e75d584ff04449322f0f098241.zip
frameworks_av-557847ee511dd5e75d584ff04449322f0f098241.tar.gz
frameworks_av-557847ee511dd5e75d584ff04449322f0f098241.tar.bz2
am a6ca0acf: am bd3e2e03: camera2: Fix segfault when using null availability listener
* commit 'a6ca0acf0d009acf45b05561273aaad44ab22533': camera2: Fix segfault when using null availability listener
Diffstat (limited to 'services')
-rw-r--r--services/camera/libcameraservice/CameraService.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp
index 87027f7..f512db2 100644
--- a/services/camera/libcameraservice/CameraService.cpp
+++ b/services/camera/libcameraservice/CameraService.cpp
@@ -655,6 +655,11 @@ status_t CameraService::addListener(
const sp<ICameraServiceListener>& listener) {
ALOGV("%s: Add listener %p", __FUNCTION__, listener.get());
+ if (listener == 0) {
+ ALOGE("%s: Listener must not be null", __FUNCTION__);
+ return BAD_VALUE;
+ }
+
Mutex::Autolock lock(mServiceLock);
Vector<sp<ICameraServiceListener> >::iterator it, end;
@@ -683,6 +688,11 @@ status_t CameraService::removeListener(
const sp<ICameraServiceListener>& listener) {
ALOGV("%s: Remove listener %p", __FUNCTION__, listener.get());
+ if (listener == 0) {
+ ALOGE("%s: Listener must not be null", __FUNCTION__);
+ return BAD_VALUE;
+ }
+
Mutex::Autolock lock(mServiceLock);
Vector<sp<ICameraServiceListener> >::iterator it;