[FFmpeg-devel] [PATCH] lavd/caca: create display *after* checking dither options

Stefano Sabatini stefasab at gmail.com
Sat Jul 21 19:13:35 CEST 2012


On date Saturday 2012-07-21 16:17:31 +0000, Paul B Mahol encoded:
> On 7/21/12, Stefano Sabatini <stefasab at gmail.com> wrote:
> > Avoid fastidious creation and immediate destroy of the display in case
> > one of the dither options fails to be set.
> >
> > Also add NULL checks in write_trailer(), which are now necessary since
> > the function can be called when not all the components have been
> > initialized.
> > ---
> >  libavdevice/caca.c |   38 +++++++++++++++++++++-----------------
> >  1 files changed, 21 insertions(+), 17 deletions(-)
> >
> > diff --git a/libavdevice/caca.c b/libavdevice/caca.c
> > index 15c4b4e..0d0ed42 100644
> > --- a/libavdevice/caca.c
> > +++ b/libavdevice/caca.c
> > @@ -47,9 +47,12 @@ static int caca_write_trailer(AVFormatContext *s)
> >
> >      av_freep(&c->window_title);
> >
> > -    caca_free_dither(c->dither);
> > -    caca_free_display(c->display);
> > -    caca_free_canvas(c->canvas);
> > +    if (c->display)
> > +        caca_free_display(c->display);
> > +    if (c->dither)
> > +        caca_free_dither(c->dither);
> > +    if (c->canvas)
> > +        caca_free_canvas(c->canvas);
> >      return 0;
> >  }
> 
> Those needs to be set back to NULL.

Up.
-- 
FFmpeg = Fiendish Furious Merciless Power Ermetic God
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0006-lavd-caca-create-display-after-checking-dither-optio.patch
Type: text/x-diff
Size: 2832 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120721/8d1097a5/attachment.bin>


More information about the ffmpeg-devel mailing list