[vlc-commits] mediacodec: fix jni leak

Thomas Guillem git at videolan.org
Tue Oct 14 15:44:58 CEST 2014


vlc | branch: master | Thomas Guillem <tom at gllm.fr> | Tue Oct 14 11:35:56 2014 +0200| [05644c1e54548cc4ac0b57b70000d2e5fe7d5c16] | committer: Jean-Baptiste Kempf

mediacodec: fix jni leak

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=05644c1e54548cc4ac0b57b70000d2e5fe7d5c16
---

 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 f3582f0..ece9df9 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);



More information about the vlc-commits mailing list