avcodec/mediacodec_wrapper: fix a potential local reference leak in ff_AMediaCodec_ge...
authorMatthieu Bouron <matthieu.bouron@gmail.com>
Thu, 25 Apr 2019 15:12:32 +0000 (17:12 +0200)
committerMatthieu Bouron <matthieu.bouron@gmail.com>
Mon, 22 Jul 2019 06:57:33 +0000 (08:57 +0200)
libavcodec/mediacodec_wrapper.c

index e2df07c..70e1e7c 100644 (file)
@@ -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") ||