Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/FFmpeg/FFmpeg.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@gmail.com>2017-05-10 16:57:57 +0300
committerMatthieu Bouron <matthieu.bouron@gmail.com>2017-05-11 17:28:59 +0300
commit2f43897f657974d8f94d0d075eb67dac1147ddde (patch)
tree59c3a47a157a534489d77902501c163b610db756 /libavcodec/ffjni.c
parent5d0b8b1ae307951310c7d9a8fa282fbca9b997cd (diff)
lavc/ffjni: fix local reference leak
Reviewed-by: Clément Bœsch <u@pkh.me>
Diffstat (limited to 'libavcodec/ffjni.c')
-rw-r--r--libavcodec/ffjni.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/ffjni.c b/libavcodec/ffjni.c
index 3f4c380673..b2bcae9602 100644
--- a/libavcodec/ffjni.c
+++ b/libavcodec/ffjni.c
@@ -303,6 +303,11 @@ int ff_jni_init_jfields(JNIEnv *env, void *jfields, const struct FFJniField *jfi
last_clazz = *(jclass*)((uint8_t*)jfields + jfields_mapping[i].offset) =
global ? (*env)->NewGlobalRef(env, clazz) : clazz;
+
+ if (global) {
+ (*env)->DeleteLocalRef(env, clazz);
+ }
+
} else {
if (!last_clazz) {