diff options
author | Matthieu Bouron <matthieu.bouron@gmail.com> | 2017-05-10 15:57:57 +0200 |
---|---|---|
committer | Matthieu Bouron <matthieu.bouron@gmail.com> | 2017-05-11 16:28:59 +0200 |
commit | 2f43897f657974d8f94d0d075eb67dac1147ddde (patch) | |
tree | 59c3a47a157a534489d77902501c163b610db756 | |
parent | 5d0b8b1ae307951310c7d9a8fa282fbca9b997cd (diff) | |
download | ffmpeg-2f43897f657974d8f94d0d075eb67dac1147ddde.tar.gz |
lavc/ffjni: fix local reference leak
Reviewed-by: Clément Bœsch <u@pkh.me>
-rw-r--r-- | libavcodec/ffjni.c | 5 |
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) { |