[FFmpeg-devel] vf_libvmaf: Fix memory leak

Submitted by enctac on March 25, 2018, 4:44 p.m.

Details

Message ID 20180325164449.5544-1-enctac@yahoo.co.jp
State Accepted
Commit be502ec6cde004e1fa05643282939bf3a1507922
Headers show

Commit Message

enctac March 25, 2018, 4:44 p.m.
Fixes ticket #6967
---
 libavfilter/vf_libvmaf.c | 2 ++
 1 file changed, 2 insertions(+)

Comments

Kyle Swanson April 1, 2018, 4:18 a.m.
Hi,

On Sun, Mar 25, 2018 at 9:44 AM, enctac <enctac-at-yahoo.co.jp@ffmpeg.org>
wrote:

> Fixes ticket #6967
> ---
>  libavfilter/vf_libvmaf.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c
> index dfe474c40c..42c6b66b69 100644
> --- a/libavfilter/vf_libvmaf.c
> +++ b/libavfilter/vf_libvmaf.c
> @@ -130,6 +130,8 @@ FRAMESYNC_DEFINE_CLASS(libvmaf, LIBVMAFContext, fs);
>      \
>      ret = !s->frame_set;
>       \
>      \
> +    av_frame_unref(s->gref);
>       \
> +    av_frame_unref(s->gmain);
>        \
>      s->frame_set = 0;
>        \
>      \
>      pthread_cond_signal(&s->cond);
>       \
> --
> 2.16.2
>
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel@ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Tested and pushed. Thanks!

Kyle

Patch hide | download patch | download mbox

diff --git a/libavfilter/vf_libvmaf.c b/libavfilter/vf_libvmaf.c
index dfe474c40c..42c6b66b69 100644
--- a/libavfilter/vf_libvmaf.c
+++ b/libavfilter/vf_libvmaf.c
@@ -130,6 +130,8 @@  FRAMESYNC_DEFINE_CLASS(libvmaf, LIBVMAFContext, fs);
     \
     ret = !s->frame_set;                                                        \
     \
+    av_frame_unref(s->gref);                                                    \
+    av_frame_unref(s->gmain);                                                   \
     s->frame_set = 0;                                                           \
     \
     pthread_cond_signal(&s->cond);                                              \