diff options
author | Lucas Gomez Jimenez <lucas.gomezjimenez@tomtom.com> | 2015-06-09 14:51:03 +0200 |
---|---|---|
committer | Steve Kondik <steve@cyngn.com> | 2015-10-27 15:11:37 -0700 |
commit | 8d3972e660023f33dd5082c83d4b9b6a09505581 (patch) | |
tree | 290fa36e9239c6e16a6efab88b7dbadc1fe9a4e7 /media/jni/audioeffect | |
parent | 122d76e99ee0f7858eab2536042fb0e75f9f9f5a (diff) | |
download | frameworks_base-8d3972e660023f33dd5082c83d4b9b6a09505581.zip frameworks_base-8d3972e660023f33dd5082c83d4b9b6a09505581.tar.gz frameworks_base-8d3972e660023f33dd5082c83d4b9b6a09505581.tar.bz2 |
Fix in effectCallback to avoid sending callbacks to dead objects
This issue can be easily reproduced by killing an application that
is playing audio using one or more audio effects.
Change-Id: I5f90c65c58d9f2df0737eeed2fbbb0c43aaa0f81
Diffstat (limited to 'media/jni/audioeffect')
-rw-r--r-- | media/jni/audioeffect/android_media_AudioEffect.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/media/jni/audioeffect/android_media_AudioEffect.cpp b/media/jni/audioeffect/android_media_AudioEffect.cpp index aba4bbe..c392034 100644 --- a/media/jni/audioeffect/android_media_AudioEffect.cpp +++ b/media/jni/audioeffect/android_media_AudioEffect.cpp @@ -162,6 +162,15 @@ static void effectCallback(int event, void* user, void *info) { ALOGV("EVENT_PARAMETER_CHANGED"); break; case AudioEffect::EVENT_ERROR: + if (info == 0) { + ALOGW("EVENT_ERROR info == NULL"); + goto effectCallback_Exit; + } + status_t status = *(status_t *)info; + if (status == DEAD_OBJECT) { + ALOGE("effectCallback: Client died, no need to send callback"); + goto effectCallback_Exit; + } ALOGW("EVENT_ERROR"); break; } |