[FFmpeg-devel] [fix-multiple-filter-chain.patch PATCH 1/2] Make configure_filters() return a meaningful error code rather than always -1.

Stefano Sabatini stefano.sabatini-lala
Fri Jul 9 00:57:14 CEST 2010


On date Wednesday 2010-07-07 14:42:36 +0200, Benoit Fouet encoded:
> Hi,
> 
> On Wed,  7 Jul 2010 13:21:49 +0200 Stefano Sabatini wrote:
> > ---
> >  ffmpeg.c |   53 +++++++++++++++++++++++++++--------------------------
> >  1 files changed, 27 insertions(+), 26 deletions(-)
> > 
> > diff --git a/ffmpeg.c b/ffmpeg.c
> > index d5fd6a0..d734cdf 100644
> > --- a/ffmpeg.c
> > +++ b/ffmpeg.c
> > @@ -406,20 +406,21 @@ static int configure_filters(AVInputStream *ist, AVOutputStream *ost)
> >      AVCodecContext *codec = ost->st->codec;
> >      AVCodecContext *icodec = ist->st->codec;
> >      char args[255];
> > +    int ret;
> >  
> >      graph = av_mallocz(sizeof(AVFilterGraph));
> >  
> 
> This is already the case today, but this graph is often leaked.
> Also, when configure_filters is failing, ffmpeg is exit()ing instead of
> av_exit()ing.
> 
> >      if (!(ist->input_video_filter = avfilter_open(avfilter_get_by_name("buffer"), "src")))
> > -        return -1;
> > +        return AVERROR(EINVAL);
> 
> What I mean is that those should probably be goto's and the vfilters
> case should also free the memory it allocates.

OK but that would be a separate issue/patch.

Regards.
-- 
FFmpeg = Faithless and Frightening Magical Practical Exploitable Game



More information about the ffmpeg-devel mailing list