diff options
author | James Dong <jdong@google.com> | 2012-12-28 09:47:46 -0800 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-12-28 09:47:46 -0800 |
commit | f3ec15425fcd828586d3bbcea7ceffd75012f7a4 (patch) | |
tree | 75a1257dc2c781160ca6cbdd06f48b6f013caeb1 /media/jni | |
parent | cf1df1944832d43aa95d3d8f6a84bea31096ad65 (diff) | |
parent | edde28fd0956d941e4962e3228f3030e203da4aa (diff) | |
download | frameworks_base-f3ec15425fcd828586d3bbcea7ceffd75012f7a4.zip frameworks_base-f3ec15425fcd828586d3bbcea7ceffd75012f7a4.tar.gz frameworks_base-f3ec15425fcd828586d3bbcea7ceffd75012f7a4.tar.bz2 |
am edde28fd: am 5d5526aa: Merge "Handle errors from AudioEffect::queryNumberEffects"
* commit 'edde28fd0956d941e4962e3228f3030e203da4aa':
Handle errors from AudioEffect::queryNumberEffects
Diffstat (limited to 'media/jni')
-rw-r--r-- | media/jni/audioeffect/android_media_AudioEffect.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/media/jni/audioeffect/android_media_AudioEffect.cpp b/media/jni/audioeffect/android_media_AudioEffect.cpp index 3b325b7..bcab4f3 100644 --- a/media/jni/audioeffect/android_media_AudioEffect.cpp +++ b/media/jni/audioeffect/android_media_AudioEffect.cpp @@ -705,7 +705,7 @@ android_media_AudioEffect_native_queryEffects(JNIEnv *env, jclass clazz) { effect_descriptor_t desc; char str[EFFECT_STRING_LEN_MAX]; - uint32_t numEffects; + uint32_t numEffects = 0; uint32_t i = 0; jstring jdescType; jstring jdescUuid; @@ -714,7 +714,10 @@ android_media_AudioEffect_native_queryEffects(JNIEnv *env, jclass clazz) jstring jdescImplementor; jobject jdesc; - AudioEffect::queryNumberEffects(&numEffects); + if (AudioEffect::queryNumberEffects(&numEffects) != NO_ERROR) { + return NULL; + } + jobjectArray ret = env->NewObjectArray(numEffects, fields.clazzDesc, NULL); if (ret == NULL) { return ret; |