[MPlayer-cvslog] r38396 - in trunk/libmpcodecs: vf.c vf_ass.c

reimar subversion at mplayerhq.hu
Tue Aug 30 22:27:29 EEST 2022


Author: reimar
Date: Tue Aug 30 22:27:29 2022
New Revision: 38396

Log:
vf.c: Fix minor memleak in filters.

When filters use vf_opts, vf.c allocates vf->priv.
Most filters then free it in uninit.
However when there is no uninit function, vf.c must
free it.
Also fix vf_ass.c to free vf->priv in its uninit.

Modified:
   trunk/libmpcodecs/vf.c
   trunk/libmpcodecs/vf_ass.c

Modified: trunk/libmpcodecs/vf.c
==============================================================================
--- trunk/libmpcodecs/vf.c	Tue Aug 30 22:24:16 2022	(r38395)
+++ trunk/libmpcodecs/vf.c	Tue Aug 30 22:27:29 2022	(r38396)
@@ -770,6 +770,7 @@ vf_instance_t* append_filters(vf_instanc
 
 void vf_uninit_filter(vf_instance_t* vf){
     if(vf->uninit) vf->uninit(vf);
+    else free(vf->priv);
     free_mp_image(vf->imgctx.static_images[0]);
     free_mp_image(vf->imgctx.static_images[1]);
     free_mp_image(vf->imgctx.temp_images[0]);

Modified: trunk/libmpcodecs/vf_ass.c
==============================================================================
--- trunk/libmpcodecs/vf_ass.c	Tue Aug 30 22:24:16 2022	(r38395)
+++ trunk/libmpcodecs/vf_ass.c	Tue Aug 30 22:27:29 2022	(r38396)
@@ -879,6 +879,7 @@ static void uninit(struct vf_instance *v
     for (i = 0; i < MP_MAX_PLANES; i++)
         av_free(vf->priv->alphas[i]);
     av_free(vf->priv->dirty_rows);
+    free(vf->priv);
 }
 
 static const unsigned int fmt_list[] = {


More information about the MPlayer-cvslog mailing list