[vlc-commits] mediacodec: fix jni leak

Thomas Guillem git at videolan.org
Wed Oct 15 10:49:57 CEST 2014


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

mediacodec: fix jni leak

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>
(cherry picked from commit 05644c1e54548cc4ac0b57b70000d2e5fe7d5c16)
Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

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

 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 8716929..e2d733c 100644
--- a/modules/codec/omxil/android_mediacodec.c
+++ b/modules/codec/omxil/android_mediacodec.c
@@ -392,6 +392,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);
@@ -437,6 +438,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