On 07/12/2017 14:49, Li, Zhong wrote:
-----Original Message-----
From: libav-devel [mailto:[email protected]] On Behalf Of Luca
Barbato
Sent: Thursday, December 7, 2017 8:25 PM
To: [email protected]
Subject: Re: [libav-devel] [PATCH] qsv/vp8dec: fix memory leak issue

On 07/12/2017 08:26, Zhong Li wrote:
Signed-off-by: Zhong Li <[email protected]>
---
   libavcodec/qsvdec_other.c | 5 +++++
   1 file changed, 5 insertions(+)

diff --git a/libavcodec/qsvdec_other.c b/libavcodec/qsvdec_other.c
index 1ba803b..cc5f205 100644
--- a/libavcodec/qsvdec_other.c
+++ b/libavcodec/qsvdec_other.c
@@ -60,6 +60,11 @@ static av_cold int
qsv_decode_close(AVCodecContext *avctx)
   {
       QSVOtherContext *s = avctx->priv_data;

+#if CONFIG_VP8_QSV_DECODER
+    if (avctx->codec_id == AV_CODEC_ID_VP8)
+        av_freep(&s->qsv.load_plugins); #endif
+
       ff_qsv_decode_close(&s->qsv);

       qsv_clear_buffers(s);


Are you sure? qsv.load_plugins should be an avoption and thus get
automatically freed once you close the codec...

qsv.load_plugins is an avoption of qsv hevc decoder/encoder, but there is no 
option for vp8 decoder.
Thus should be why I found memory leak for vp8, but no found for hevc using 
valgrind to analyze.

Ah, your solution is fine then :)

lu

_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to