[MPlayer-dev-eng] [Patch] vf_scale.c memleak

Wei Jiang jiangw98 at yahoo.com
Mon Nov 1 01:26:39 CET 2004


The local pointer need to be freed befroe the function exits, there is no other pointer store
those allocated memory pointers.

diff -u -r1.55 vf_scale.c
--- libmpcodecs/vf_scale.c	18 Sep 2004 00:08:16 -0000	1.55
+++ libmpcodecs/vf_scale.c	1 Nov 2004 00:23:28 -0000
@@ -198,6 +198,9 @@
 	    best,
 	    int_sws_flags | get_sws_cpuflags(), srcFilter, dstFilter, vf->priv->param);
     }
+    if (srcFilter) sws_freeFilter(srcFilter);
+    if (dstFilter) sws_freeFilter(dstFilter);
+    srcFilter=dstFilter=NULL;
     if(!vf->priv->ctx){
 	// error...
 	mp_msg(MSGT_VFILTER,MSGL_WARN,"Couldn't init SwScaler for this setup\n");



		
__________________________________
Do you Yahoo!?
Yahoo! Mail Address AutoComplete - You start. We finish.
http://promotions.yahoo.com/new_mail 




More information about the MPlayer-dev-eng mailing list