[FFmpeg-devel] [PATCH 2/2] avformat/movenchint: use av_freep() for saftey

Michael Niedermayer michaelni at gmx.at
Sun Aug 17 13:28:22 CEST 2014


On Sun, Aug 17, 2014 at 12:24:27PM +0200, Paul B Mahol wrote:
> On 8/16/14, Michael Niedermayer <michaelni at gmx.at> wrote:
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libavformat/movenchint.c |    4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> >
> > diff --git a/libavformat/movenchint.c b/libavformat/movenchint.c
> > index 2602254..006aa09 100644
> > --- a/libavformat/movenchint.c
> > +++ b/libavformat/movenchint.c
> > @@ -72,7 +72,7 @@ static void sample_queue_pop(HintSampleQueue *queue)
> >      if (queue->len <= 0)
> >          return;
> >      if (queue->samples[0].own_data)
> > -        av_free(queue->samples[0].data);
> > +        av_freep(&queue->samples[0].data);
> >      queue->len--;
> >      memmove(queue->samples, queue->samples + 1,
> > sizeof(HintSample)*queue->len);
> >  }
> > @@ -85,7 +85,7 @@ static void sample_queue_free(HintSampleQueue *queue)
> >      int i;
> >      for (i = 0; i < queue->len; i++)
> >          if (queue->samples[i].own_data)
> > -            av_free(queue->samples[i].data);
> > +            av_freep(&queue->samples[i].data);
> >      av_freep(&queue->samples);
> >      queue->len  = 0;
> >      queue->size = 0;
> > --
> > 1.7.9.5
> >
> > _______________________________________________
> > ffmpeg-devel mailing list
> > ffmpeg-devel at ffmpeg.org
> > http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> >
> 
> typo saftey -> safety

changed


> 
> lgtm

applied

thanks

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

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- 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/20140817/1e121a81/attachment.asc>


More information about the ffmpeg-devel mailing list