summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorMatthieu Bouron <matthieu.bouron@gmail.com>2017-12-16 00:16:02 +0100
committerMatthieu Bouron <matthieu.bouron@gmail.com>2017-12-16 00:52:28 +0100
commit1f1207145a0f2d26e5e3525bea6cc417a3ec39cf (patch)
tree680ffc9f3a45c30c39dc1c043c59383eabd48e86 /libavcodec
parentf3cffd121b990717996d8ddd646bd555c1db135b (diff)
lavc/mediacodec_wrapper: fix potential jni global reference leak
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/mediacodec_wrapper.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/mediacodec_wrapper.c b/libavcodec/mediacodec_wrapper.c
index 329a5eb896..d9f0e27a7d 100644
--- a/libavcodec/mediacodec_wrapper.c
+++ b/libavcodec/mediacodec_wrapper.c
@@ -1206,6 +1206,9 @@ fail:
}
if (ret < 0) {
+ if (codec->object) {
+ (*env)->DeleteGlobalRef(env, codec->object);
+ }
ff_jni_reset_jfields(env, &codec->jfields, jni_amediacodec_mapping, 1, codec);
av_freep(&codec);
}