summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJames Dong <jdong@google.com>2012-12-28 09:59:17 -0800
committerAndroid Git Automerger <android-git-automerger@android.com>2012-12-28 09:59:17 -0800
commit38a2758e505a5e1032a732cf7b1155a672913c8b (patch)
tree2e96ff99794abbcec3ca5d01f3df762d065594e5 /media
parent6354a1989f96c13777a9ccf5bc25f92210fbed9b (diff)
parentf3ec15425fcd828586d3bbcea7ceffd75012f7a4 (diff)
downloadframeworks_base-38a2758e505a5e1032a732cf7b1155a672913c8b.zip
frameworks_base-38a2758e505a5e1032a732cf7b1155a672913c8b.tar.gz
frameworks_base-38a2758e505a5e1032a732cf7b1155a672913c8b.tar.bz2
am f3ec1542: am edde28fd: am 5d5526aa: Merge "Handle errors from AudioEffect::queryNumberEffects"
* commit 'f3ec15425fcd828586d3bbcea7ceffd75012f7a4': Handle errors from AudioEffect::queryNumberEffects
Diffstat (limited to 'media')
-rw-r--r--media/jni/audioeffect/android_media_AudioEffect.cpp7
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;