[FFmpeg-devel] [PATCH] avfilter/vf_zoompan: free out AVFrame on failure

Michael Niedermayer michaelni at gmx.at
Wed May 13 01:59:12 CEST 2015


On Tue, May 12, 2015 at 10:12:11PM +0200, Paul B Mahol wrote:
> Dana 12. 5. 2015. 20:07 osoba "Michael Niedermayer" <michaelni at gmx.at>
> napisala je:
> >
> > Fixes: CID1197065
> >
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavfilter/vf_zoompan.c |    4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/libavfilter/vf_zoompan.c b/libavfilter/vf_zoompan.c
> > index d126851..c49193a 100644
> > --- a/libavfilter/vf_zoompan.c
> > +++ b/libavfilter/vf_zoompan.c
> > @@ -127,7 +127,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
> *in)
> >      ZPContext *s = ctx->priv;
> >      double var_values[VARS_NB], nb_frames, zoom, dx, dy;
> >      const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(in->format);
> > -    AVFrame *out;
> > +    AVFrame *out = NULL;
> >      int i, k, x, y, w, h, ret = 0;
> >
> >      var_values[VAR_IN_W]  = var_values[VAR_IW] = in->width;
> > @@ -232,6 +232,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
> *in)
> >          ret = ff_filter_frame(outlink, out);
> >          if (ret < 0)
> >              break;
> > +        out = NULL;
> >
> >          sws_freeContext(s->sws);
> >          s->sws = NULL;
> > @@ -245,6 +246,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame
> *in)
> >  fail:
> >      sws_freeContext(s->sws);
> >      s->sws = NULL;
> > +    av_frame_free(&out);
> >      av_frame_free(&in);
> >      return ret;
> >  }
> > --
> > 1.7.9.5
> >
> 
> LGTM

applied

thanks

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

The bravest are surely those who have the clearest vision
of what is before them, glory and danger alike, and yet
notwithstanding go out to meet it. -- Thucydides
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150513/df402c6b/attachment.asc>


More information about the ffmpeg-devel mailing list