[FFmpeg-devel] [PATCH 1/2] postproc: use av_freep() for saftey

Michael Niedermayer michaelni at gmx.at
Sat Aug 16 23:28:27 CEST 2014


On Sat, Aug 16, 2014 at 10:02:50PM +0200, Clément Bœsch wrote:
> On Sat, Aug 16, 2014 at 07:54:24PM +0200, Michael Niedermayer wrote:
> > Signed-off-by: Michael Niedermayer <michaelni at gmx.at>
> > ---
> >  libpostproc/postprocess.c |   22 +++++++++++-----------
> >  1 file changed, 11 insertions(+), 11 deletions(-)
> > 
> > diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
> > index 794cd30..397e4fb 100644
> > --- a/libpostproc/postprocess.c
> > +++ b/libpostproc/postprocess.c
> > @@ -931,17 +931,17 @@ void pp_free_context(void *vc){
> >      PPContext *c = (PPContext*)vc;
> >      int i;
> >  
> > -    for(i=0; i<3; i++) av_free(c->tempBlurred[i]);
> > -    for(i=0; i<3; i++) av_free(c->tempBlurredPast[i]);
> > -
> > -    av_free(c->tempBlocks);
> > -    av_free(c->yHistogram);
> > -    av_free(c->tempDst);
> > -    av_free(c->tempSrc);
> > -    av_free(c->deintTemp);
> > -    av_free(c->stdQPTable);
> > -    av_free(c->nonBQPTable);
> > -    av_free(c->forcedQPTable);
> > +    for(i=0; i<3; i++) av_freep(&c->tempBlurred[i]);
> > +    for(i=0; i<3; i++) av_freep(&c->tempBlurredPast[i]);
> > +
> > +    av_freep(&c->tempBlocks);
> > +    av_freep(&c->yHistogram);
> > +    av_freep(&c->tempDst);
> > +    av_freep(&c->tempSrc);
> > +    av_freep(&c->deintTemp);
> > +    av_freep(&c->stdQPTable);
> > +    av_freep(&c->nonBQPTable);
> > +    av_freep(&c->forcedQPTable);
> >  
> >      memset(c, 0, sizeof(PPContext));
> 
> Isn't it the goal of this memset?

right, change is redundant, patch droped


[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

When you are offended at any man's fault, turn to yourself and study your
own failings. Then you will forget your anger. -- Epictetus
-------------- 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/20140816/92e688c4/attachment.asc>


More information about the ffmpeg-devel mailing list