mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
lavc/ffjni: fix local reference leak
Reviewed-by: Clément Bœsch <u@pkh.me>
This commit is contained in:
parent
5d0b8b1ae3
commit
2f43897f65
@ -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) =
|
last_clazz = *(jclass*)((uint8_t*)jfields + jfields_mapping[i].offset) =
|
||||||
global ? (*env)->NewGlobalRef(env, clazz) : clazz;
|
global ? (*env)->NewGlobalRef(env, clazz) : clazz;
|
||||||
|
|
||||||
|
if (global) {
|
||||||
|
(*env)->DeleteLocalRef(env, clazz);
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (!last_clazz) {
|
if (!last_clazz) {
|
||||||
|
Loading…
Reference in New Issue
Block a user