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

Clément Bœsch u at pkh.me
Sat Aug 16 22:02:50 CEST 2014


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?

-- 
Clément B.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20140816/dfcb2f14/attachment.asc>


More information about the ffmpeg-devel mailing list