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

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


ffmpeg | branch: release/4.2 | Matthieu Bouron <matthieu.bouron at gmail.com> | Thu Apr 25 17:12:32 2019 +0200| [3abec7f39735a1cda83c002937abe107bb47caa9] | committer: Matthieu Bouron

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

(cherry picked from commit 3f232d713db3cb665c265387c7009904c2e85e58)

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

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

diff --git a/libavcodec/mediacodec_wrapper.c b/libavcodec/mediacodec_wrapper.c
index e2df07cb41..70e1e7cae1 100644
--- a/libavcodec/mediacodec_wrapper.c
+++ b/libavcodec/mediacodec_wrapper.c
@@ -469,6 +469,11 @@ char *ff_AMediaCodecList_getCodecNameByType(const char *mime, int profile, int e
                     goto done;
                 }
 
+                if (codec_name) {
+                    (*env)->DeleteLocalRef(env, codec_name);
+                    codec_name = NULL;
+                }
+
                 /* Skip software decoders */
                 if (
                     strstr(name, "OMX.google") ||



More information about the ffmpeg-cvslog mailing list