summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@gmail.com>2017-05-10 15:57:57 +0200
committerMatthieu Bouron <matthieu.bouron@gmail.com>2017-05-11 16:28:59 +0200
commit2f43897f657974d8f94d0d075eb67dac1147ddde (patch)
tree59c3a47a157a534489d77902501c163b610db756
parent5d0b8b1ae307951310c7d9a8fa282fbca9b997cd (diff)
downloadffmpeg-streaming-2f43897f657974d8f94d0d075eb67dac1147ddde.zip
ffmpeg-streaming-2f43897f657974d8f94d0d075eb67dac1147ddde.tar.gz
lavc/ffjni: fix local reference leak
Reviewed-by: Clément Bœsch <u@pkh.me>
-rw-r--r--libavcodec/ffjni.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/libavcodec/ffjni.c b/libavcodec/ffjni.c
index 3f4c380..b2bcae9 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) {
OpenPOWER on IntegriCloud