[FFmpeg-cvslog] avcodec/mediacodec_wrapper: fix a local reference leak in ff_AMediaCodec_getName()

Matthieu Bouron git at videolan.org
Fri Jul 26 19:30:33 EEST 2019


ffmpeg | branch: release/4.2 | Matthieu Bouron <matthieu.bouron at gmail.com> | Thu Apr 25 17:40:55 2019 +0200| [a3d986ff47b15dcfdda3060d1b9ea3ae81a3d7ad] | committer: Matthieu Bouron

avcodec/mediacodec_wrapper: fix a local reference leak in ff_AMediaCodec_getName()

(cherry picked from commit 9cb8875c165e6377a3eebdce9743c5579f131248)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a3d986ff47b15dcfdda3060d1b9ea3ae81a3d7ad
---

 libavcodec/mediacodec_wrapper.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/libavcodec/mediacodec_wrapper.c b/libavcodec/mediacodec_wrapper.c
index a024e3bdb1..e2df07cb41 100644
--- a/libavcodec/mediacodec_wrapper.c
+++ b/libavcodec/mediacodec_wrapper.c
@@ -1337,6 +1337,10 @@ char *ff_AMediaCodec_getName(FFAMediaCodec *codec)
     ret = ff_jni_jstring_to_utf_chars(env, name, codec);
 
 fail:
+    if (name) {
+        (*env)->DeleteLocalRef(env, name);
+    }
+
     return ret;
 }
 



More information about the ffmpeg-cvslog mailing list