diff options
author | Igor Murashkin <iam@google.com> | 2014-03-18 00:20:54 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-03-18 00:20:54 +0000 |
commit | 557847ee511dd5e75d584ff04449322f0f098241 (patch) | |
tree | bae95f72a0c78169db8fd138f82629e73400bac3 /services | |
parent | 9a9481f89b26211b20d7f3fde3d54b455843bf70 (diff) | |
parent | a6ca0acf0d009acf45b05561273aaad44ab22533 (diff) | |
download | frameworks_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.cpp | 10 |
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; |