[FFmpeg-cvslog] avcodec/mediacodec_wrapper: fix {input,output}_buffers global reference leak

Matthieu Bouron git at videolan.org
Wed May 20 10:37:29 EEST 2020


ffmpeg | branch: release/4.2 | Matthieu Bouron <matthieu.bouron at gmail.com> | Thu Apr  9 16:53:21 2020 +0200| [a7b0ab2a23ad461d73072f61ac05feb36c498f36] | committer: Matthieu Bouron

avcodec/mediacodec_wrapper: fix {input,output}_buffers global reference leak

Fixes ticket #8607.

Signed-off-by: Matthieu Bouron <matthieu.bouron at gmail.com>
(cherry picked from commit 5216edbc54c79869ce630579199e53454f96df96)

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a7b0ab2a23ad461d73072f61ac05feb36c498f36
---

 libavcodec/mediacodec_wrapper.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavcodec/mediacodec_wrapper.c b/libavcodec/mediacodec_wrapper.c
index 5213cf640a..79abc8b6aa 100644
--- a/libavcodec/mediacodec_wrapper.c
+++ b/libavcodec/mediacodec_wrapper.c
@@ -1303,6 +1303,12 @@ int ff_AMediaCodec_delete(FFAMediaCodec* codec)
         ret = AVERROR_EXTERNAL;
     }
 
+    (*env)->DeleteGlobalRef(env, codec->input_buffers);
+    codec->input_buffers = NULL;
+
+    (*env)->DeleteGlobalRef(env, codec->output_buffers);
+    codec->output_buffers = NULL;
+
     (*env)->DeleteGlobalRef(env, codec->object);
     codec->object = NULL;
 



More information about the ffmpeg-cvslog mailing list