[MPlayer-dev-eng] RE:[Patch] vf_scale.c memleak
Wei Jiang
jiangw98 at yahoo.com
Mon Nov 1 18:21:38 CET 2004
Though it is true that you have a static variable, but there is a the same name
local varible in the function where the code reisdes
Here is the line:
static int config(struct vf_instance_s* vf,
int width, int height, int d_width, int d_height,
unsigned int flags, unsigned int outfmt){
unsigned int best=find_best_out(vf);
int vo_flags;
int int_sws_flags=0;
SwsFilter *srcFilter, *dstFilter;
-------------------------------------------------------------------------------
-----------------------------------------------------------------------------
Message: 5
Date: Mon, 1 Nov 2004 02:18:08 +0100
From: Michael Niedermayer <michaelni at gmx.at>
Subject: Re: [MPlayer-dev-eng] [Patch] vf_scale.c memleak
To: mplayer-dev-eng at mplayerhq.hu
Message-ID: <200411010218.10369.michaelni at gmx.at>
Content-Type: text/plain; charset="iso-8859-1"
Hi
On Monday 01 November 2004 01:26, Wei Jiang wrote:
> The local pointer need to be freed befroe the function exits, there is no
> other pointer store those allocated memory pointers.
static SwsFilter *src_filter= NULL;
>
> 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;
rejected
[...]
--
Michael
"I do not agree with what you have to say, but I'll defend to the death your
right to say it." -- Voltaire
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
More information about the MPlayer-dev-eng
mailing list