diff options
author | Eric Laurent <elaurent@google.com> | 2014-11-12 20:19:51 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-11-12 20:19:52 +0000 |
commit | edd4a227e5f49b859f16105a100568fcef4927a3 (patch) | |
tree | e63c492dde497587b3fbf6fba64cb92cd28468a9 /core/jni | |
parent | 850ec91e88c2b0911f8460f909eabf4078b78582 (diff) | |
parent | 449c5887101047d187a55217ced6d8a5c98fb367 (diff) | |
download | frameworks_base-edd4a227e5f49b859f16105a100568fcef4927a3.zip frameworks_base-edd4a227e5f49b859f16105a100568fcef4927a3.tar.gz frameworks_base-edd4a227e5f49b859f16105a100568fcef4927a3.tar.bz2 |
Merge "audiosystem JNI: check env pointer before use." into lmp-mr1-dev
Diffstat (limited to 'core/jni')
-rw-r--r-- | core/jni/android_media_AudioSystem.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/jni/android_media_AudioSystem.cpp b/core/jni/android_media_AudioSystem.cpp index f099289..4b4b367 100644 --- a/core/jni/android_media_AudioSystem.cpp +++ b/core/jni/android_media_AudioSystem.cpp @@ -160,6 +160,9 @@ JNIAudioPortCallback::~JNIAudioPortCallback() { // remove global references JNIEnv *env = AndroidRuntime::getJNIEnv(); + if (env == NULL) { + return; + } env->DeleteGlobalRef(mObject); env->DeleteGlobalRef(mClass); } @@ -167,7 +170,9 @@ JNIAudioPortCallback::~JNIAudioPortCallback() void JNIAudioPortCallback::sendEvent(int event) { JNIEnv *env = AndroidRuntime::getJNIEnv(); - + if (env == NULL) { + return; + } env->CallStaticVoidMethod(mClass, gPostEventFromNative, mObject, event, 0, 0, NULL); if (env->ExceptionCheck()) { |