[vlc-devel] [PATCH 2/3] mediacodec: fix jni leak

Thomas Guillem tom at gllm.fr
Tue Oct 14 11:35:56 CEST 2014


---
 modules/codec/omxil/android_mediacodec.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/modules/codec/omxil/android_mediacodec.c b/modules/codec/omxil/android_mediacodec.c
index 13d774a..72832f4 100644
--- a/modules/codec/omxil/android_mediacodec.c
+++ b/modules/codec/omxil/android_mediacodec.c
@@ -399,6 +399,7 @@ static int OpenDecoder(vlc_object_t *p_this)
         if ((*env)->ExceptionOccurred(env)) {
             msg_Warn(p_dec, "Exception occurred in MediaCodecInfo.getCapabilitiesForType");
             (*env)->ExceptionClear(env);
+            (*env)->DeleteLocalRef(env, info);
             break;
         } else if (codec_capabilities) {
             profile_levels = (*env)->GetObjectField(env, codec_capabilities, p_sys->profile_levels_field);
@@ -444,6 +445,7 @@ static int OpenDecoder(vlc_object_t *p_this)
             p_sys->name[name_len] = '\0';
             (*env)->ReleaseStringUTFChars(env, name, name_ptr);
             codec_name = name;
+            (*env)->DeleteLocalRef(env, info);
             break;
         }
         (*env)->DeleteLocalRef(env, info);
-- 
2.1.0




More information about the vlc-devel mailing list