[FFmpeg-devel] [PATCH] lavfi/buffersrc: fix memleak

Nicolas George nicolas.george at normalesup.org
Tue Jun 19 22:04:05 CEST 2012


Le duodi 2 messidor, an CCXX, Paul B Mahol a écrit :
> Signed-off-by: Paul B Mahol <onemda at gmail.com>
> ---
>  libavfilter/buffersrc.c |    3 +--
>  1 files changed, 1 insertions(+), 2 deletions(-)
> 
> diff --git a/libavfilter/buffersrc.c b/libavfilter/buffersrc.c
> index b50a5e1..e557983 100644
> --- a/libavfilter/buffersrc.c
> +++ b/libavfilter/buffersrc.c
> @@ -242,7 +242,7 @@ static av_cold int init_video(AVFilterContext *ctx, const char *args, void *opaq
>  {
>      BufferSourceContext *c = ctx->priv;
>      char pix_fmt_str[128], sws_param[256] = "", *colon, *equal;
> -    int ret, n = 0;
> +    int ret = 0, n = 0;
>  
>      c->class = &vbuffer_class;
>  
> @@ -287,7 +287,6 @@ static av_cold int init_video(AVFilterContext *ctx, const char *args, void *opaq
>             c->w, c->h, av_pix_fmt_descriptors[c->pix_fmt].name,
>             c->time_base.num, c->time_base.den, c->frame_rate.num, c->frame_rate.den,
>             c->pixel_aspect.num, c->pixel_aspect.den, (char *)av_x_if_null(c->sws_param, ""));
> -    return 0;
>  
>  fail:
>      av_opt_free(c);

What leak does that fix? I thought it could be c->sws_param, but it is freed
in uninit.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120619/ba8d2589/attachment.asc>


More information about the ffmpeg-devel mailing list