diff options
author | Igor Murashkin <iam@google.com> | 2014-03-17 22:56:00 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-03-17 22:56:00 +0000 |
commit | a6ca0acf0d009acf45b05561273aaad44ab22533 (patch) | |
tree | e6c7049fd6bbce66f21b37f5d08bd371daeaf87f /services | |
parent | 8788c40c7b5bdcaef1dcaa7f36598ae767880047 (diff) | |
parent | bd3e2e03f3ab686c52982a9e50cae853128172cf (diff) | |
download | frameworks_av-a6ca0acf0d009acf45b05561273aaad44ab22533.zip frameworks_av-a6ca0acf0d009acf45b05561273aaad44ab22533.tar.gz frameworks_av-a6ca0acf0d009acf45b05561273aaad44ab22533.tar.bz2 |
am bd3e2e03: camera2: Fix segfault when using null availability listener
* commit 'bd3e2e03f3ab686c52982a9e50cae853128172cf':
camera2: Fix segfault when using null availability listener
Diffstat (limited to 'services')
-rw-r--r-- | services/camera/libcameraservice/CameraService.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/services/camera/libcameraservice/CameraService.cpp b/services/camera/libcameraservice/CameraService.cpp index eeedfc9..5957d97 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; |