diff options
author | Eric Laurent <elaurent@google.com> | 2014-11-12 11:07:48 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2014-11-12 11:07:48 -0800 |
commit | 449c5887101047d187a55217ced6d8a5c98fb367 (patch) | |
tree | f28877c90cbb98c2c960038e1cc2ffbff4132c0d /core/jni | |
parent | a0ecc714c3aeaaa05649e0ab1f054cc8efbb126f (diff) | |
download | frameworks_base-449c5887101047d187a55217ced6d8a5c98fb367.zip frameworks_base-449c5887101047d187a55217ced6d8a5c98fb367.tar.gz frameworks_base-449c5887101047d187a55217ced6d8a5c98fb367.tar.bz2 |
audiosystem JNI: check env pointer before use.
Bug: 18332935.
Change-Id: I1ec820f0282833e13444ec05d50da3ce70d19d8d
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()) { |